From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============8431573809233188789==" MIME-Version: 1.0 From: kernel test robot Subject: arch/powerpc/net/bpf_jit_comp32.c:190:36: warning: Either the condition 'if(image&&rel<33554432&&rel>=-33554432)' is redundant or there is pointer arithmetic with NULL pointer. [nullPointerArithmeticRedundantCheck] Date: Fri, 11 Feb 2022 14:02:26 +0800 Message-ID: <202202111034.QObItiuu-lkp@intel.com> List-Id: To: kbuild@lists.01.org --===============8431573809233188789== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable CC: kbuild-all(a)lists.01.org CC: linux-kernel(a)vger.kernel.org TO: Christophe Leroy CC: Michael Ellerman tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git = master head: e3c85076d7a6f986445b9008be7e7f83d1b0780a commit: ee7c3ec3b4b1222b30272624897826bc40d79bc5 powerpc/ebpf32: Use standa= rd function call for functions within 32M distance date: 10 months ago :::::: branch date: 13 hours ago :::::: commit date: 10 months ago compiler: powerpc-linux-gcc (GCC) 11.2.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot cppcheck possible warnings: (new ones prefixed by >>, may not real problems) >> arch/powerpc/net/bpf_jit_comp32.c:190:36: warning: Either the condition = 'if(image&&rel<33554432&&rel>=3D-33554432)' is redundant or there is pointe= r arithmetic with NULL pointer. [nullPointerArithmeticRedundantCheck] s32 rel =3D (s32)func - (s32)(image + ctx->idx); ^ arch/powerpc/net/bpf_jit_comp32.c:192:5: note: Assuming that condition '= if(image&&rel<33554432&&rel>=3D-33554432)' is not redundant if (image && rel < 0x2000000 && rel >=3D -0x2000000) { ^ arch/powerpc/net/bpf_jit_comp32.c:190:36: note: Null pointer addition s32 rel =3D (s32)func - (s32)(image + ctx->idx); ^ vim +190 arch/powerpc/net/bpf_jit_comp32.c 51c66ad849a703d Christophe Leroy 2021-03-22 187 = 51c66ad849a703d Christophe Leroy 2021-03-22 188 void bpf_jit_emit_func_ca= ll_rel(u32 *image, struct codegen_context *ctx, u64 func) 51c66ad849a703d Christophe Leroy 2021-03-22 189 { ee7c3ec3b4b1222 Christophe Leroy 2021-04-12 @190 s32 rel =3D (s32)func - = (s32)(image + ctx->idx); ee7c3ec3b4b1222 Christophe Leroy 2021-04-12 191 = ee7c3ec3b4b1222 Christophe Leroy 2021-04-12 192 if (image && rel < 0x200= 0000 && rel >=3D -0x2000000) { ee7c3ec3b4b1222 Christophe Leroy 2021-04-12 193 PPC_BL_ABS(func); ee7c3ec3b4b1222 Christophe Leroy 2021-04-12 194 } else { 51c66ad849a703d Christophe Leroy 2021-03-22 195 /* Load function addres= s into r0 */ 51c66ad849a703d Christophe Leroy 2021-03-22 196 EMIT(PPC_RAW_LIS(__REG_= R0, IMM_H(func))); 51c66ad849a703d Christophe Leroy 2021-03-22 197 EMIT(PPC_RAW_ORI(__REG_= R0, __REG_R0, IMM_L(func))); 51c66ad849a703d Christophe Leroy 2021-03-22 198 EMIT(PPC_RAW_MTLR(__REG= _R0)); 51c66ad849a703d Christophe Leroy 2021-03-22 199 EMIT(PPC_RAW_BLRL()); 51c66ad849a703d Christophe Leroy 2021-03-22 200 } ee7c3ec3b4b1222 Christophe Leroy 2021-04-12 201 } 51c66ad849a703d Christophe Leroy 2021-03-22 202 = --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org --===============8431573809233188789==--