powerpc: Fix compiler warning by guarding with '__powerpc64__'
PATCH RESEND 1/1 powerpc: Fix compiler warning by guarding with '__powerpc64__'
As reported by the kernel test robot, the following error occurs:
arch/powerpc/lib/sstep.c: In function 'analyse_instr':
Quoted 1 line
Quoted 1 line
arch/powerpc/lib/sstep.c:1172:28: warning: variable 'suffix' set but not used [-Wunused-but-set-variable]
1172 | unsigned int word, suffix;
| ^~~~~~
arch/powerpc/lib/sstep.c:1168:38: warning: variable 'rc' set but not used [-Wunused-but-set-variable]
1168 | unsigned int opcode, ra, rb, rc, rd, spr, u;
| ^~These variables are now conditionally defined with the '__powerpc64__' macro to ensure they are only used when applicable.
Reported-by kernel test robot <[email protected]>
Signed-off-by Yu-Chun Lin <[email protected]>
--- arch/powerpc/lib/sstep.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
arch/powerpc/lib/sstep.c +10 -2
@@ -1354,15 +1354,21 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs,#ifdef CONFIG_PPC64 unsigned int suffixopcode, prefixtype, prefix_r;#endif -unsigned int opcode, ra, rb, rc, rd, spr, u; +unsigned int opcode, ra, rb, rd, spr, u;unsigned long int imm;unsigned long int val, val2;unsigned int mb, me, sh; -unsigned int word, suffix; +unsigned int word; +#ifdef __powerpc64__ +unsigned int suffix; +unsigned int rc; +#endif long ival; word =ppc_inst_val (instr); +#ifdef __powerpc64__ suffix =ppc_inst_suffix (instr); +#endif op->type =COMPUTE ;
@@ -1480,7 +1486,9 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs, rd = (word >>21 ) &0x1f ; ra = (word >>16 ) &0x1f ; rb = (word >>11 ) &0x1f ; +#ifdef __powerpc64__ rc = (word >>6 ) &0x1f ; +#endif switch (opcode) {#ifdef __powerpc64__
Signature · 1 line
2.43.0