[PATCH] powerpc/44x/fsp2: fix a compiling error regarding macro 'mdfcr'

From: Feng Tang
Date: Fri Feb 05 2021 - 03:08:43 EST


0day's kbuild test found error:

"
CC arch/powerpc/platforms/44x/fsp2.o

{standard input}:577: Error: unsupported relocation against base
{standard input}:580: Error: unsupported relocation against base
{standard input}:583: Error: unsupported relocation against base
"

The reason is macro 'mfdcr' requirs an instant number as parameter,
which is not met by show_plbopb_regs().

Fix it by converting show_plbopb_regs() from function to macro.

Reported-by: kernel test robot <lkp@xxxxxxxxx>
Signed-off-by: Feng Tang <feng.tang@xxxxxxxxx>
---
arch/powerpc/platforms/44x/fsp2.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/powerpc/platforms/44x/fsp2.c b/arch/powerpc/platforms/44x/fsp2.c
index b299e43..4732669 100644
--- a/arch/powerpc/platforms/44x/fsp2.c
+++ b/arch/powerpc/platforms/44x/fsp2.c
@@ -66,15 +66,15 @@ static void l2regs(void)
pr_err("LOG5: 0x%08x\n", mfl2(L2LOG5));
}

-static void show_plbopb_regs(u32 base, int num)
-{
- pr_err("\nPLBOPB Bridge %d:\n", num);
- pr_err("GESR0: 0x%08x\n", mfdcr(base + PLB4OPB_GESR0));
- pr_err("GESR1: 0x%08x\n", mfdcr(base + PLB4OPB_GESR1));
- pr_err("GESR2: 0x%08x\n", mfdcr(base + PLB4OPB_GESR2));
- pr_err("GEARU: 0x%08x\n", mfdcr(base + PLB4OPB_GEARU));
- pr_err("GEAR: 0x%08x\n", mfdcr(base + PLB4OPB_GEAR));
-}
+#define show_plbopb_regs(base, num) \
+ { \
+ pr_err("\nPLBOPB Bridge %d:\n", num); \
+ pr_err("GESR0: 0x%08x\n", mfdcr(base + PLB4OPB_GESR0)); \
+ pr_err("GESR1: 0x%08x\n", mfdcr(base + PLB4OPB_GESR1)); \
+ pr_err("GESR2: 0x%08x\n", mfdcr(base + PLB4OPB_GESR2)); \
+ pr_err("GEARU: 0x%08x\n", mfdcr(base + PLB4OPB_GEARU)); \
+ pr_err("GEAR: 0x%08x\n", mfdcr(base + PLB4OPB_GEAR)); \
+ }

static irqreturn_t bus_err_handler(int irq, void *data)
{
--
2.7.4




> > date: 5 weeks ago
> > config: powerpc-randconfig-p002-20210105 (attached as .config)
> > compiler: powerpc-linux-gcc (GCC) 9.3.0
> > reproduce (this is a W=1 build):
> > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> > chmod +x ~/bin/make.cross
> > # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8b8319b181fd9d6821703fef1228b4dcde613a16
> > git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> > git fetch --no-tags linus master
> > git checkout 8b8319b181fd9d6821703fef1228b4dcde613a16
> > # save the attached .config to linux build tree
> > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc
> >
> > If you fix the issue, kindly add following tag as appropriate
> > Reported-by: kernel test robot <lkp@xxxxxxxxx>
> >
> > All errors (new ones prefixed by >>):
> >
> > {standard input}: Assembler messages:
> >>> {standard input}:577: Error: unsupported relocation against base
> > {standard input}:580: Error: unsupported relocation against base
> > {standard input}:583: Error: unsupported relocation against base
> > {standard input}:586: Error: unsupported relocation against base
> > {standard input}:589: Error: unsupported relocation against base
> > {standard input}:592: Error: unsupported relocation against base
> > {standard input}:595: Error: unsupported relocation against base
> > {standard input}:598: Error: unsupported relocation against base
> > {standard input}:601: Error: unsupported relocation against base
> > {standard input}:604: Error: unsupported relocation against base
> > {standard input}:607: Error: unsupported relocation against base
> > {standard input}:610: Error: unsupported relocation against base
> > {standard input}:613: Error: unsupported relocation against base
> > {standard input}:616: Error: unsupported relocation against base
> > {standard input}:619: Error: unsupported relocation against base
> > {standard input}:622: Error: unsupported relocation against base
> > {standard input}:625: Error: unsupported relocation against base
> > {standard input}:628: Error: unsupported relocation against base
> > {standard input}:631: Error: unsupported relocation against base
> > {standard input}:634: Error: unsupported relocation against base
> >
> > ---
> > 0-DAY CI Kernel Test Service, Intel Corporation
> > https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
> >
>