From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
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: Wed, 09 Mar 2022 09:12:38 +0800 [thread overview]
Message-ID: <202203090905.NOGhU7qG-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 2856 bytes --]
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Christophe Leroy <christophe.leroy@csgroup.eu>
CC: Michael Ellerman <mpe@ellerman.id.au>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 92f90cc9fe0e7a984ea3d4bf3d120e30ba8a2118
commit: ee7c3ec3b4b1222b30272624897826bc40d79bc5 powerpc/ebpf32: Use standard function call for functions within 32M distance
date: 11 months ago
:::::: branch date: 8 hours ago
:::::: commit date: 11 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 <lkp@intel.com>
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>=-33554432)' is redundant or there is pointer arithmetic with NULL pointer. [nullPointerArithmeticRedundantCheck]
s32 rel = (s32)func - (s32)(image + ctx->idx);
^
arch/powerpc/net/bpf_jit_comp32.c:192:5: note: Assuming that condition 'if(image&&rel<33554432&&rel>=-33554432)' is not redundant
if (image && rel < 0x2000000 && rel >= -0x2000000) {
^
arch/powerpc/net/bpf_jit_comp32.c:190:36: note: Null pointer addition
s32 rel = (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_call_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 = (s32)func - (s32)(image + ctx->idx);
ee7c3ec3b4b1222 Christophe Leroy 2021-04-12 191
ee7c3ec3b4b1222 Christophe Leroy 2021-04-12 192 if (image && rel < 0x2000000 && rel >= -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 address 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
next reply other threads:[~2022-03-09 1:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-09 1:12 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-03-19 13:38 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] kernel test robot
2022-03-12 13:17 kernel test robot
2022-02-11 6:02 kernel test robot
2021-12-21 19:13 kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202203090905.NOGhU7qG-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.