* [PATCH] um: use ARRAY_SIZE to calculate the length of an array
@ 2025-12-08 2:37 Chen Changcheng
2025-12-08 7:35 ` Johannes Berg
0 siblings, 1 reply; 2+ messages in thread
From: Chen Changcheng @ 2025-12-08 2:37 UTC (permalink / raw)
To: richard, anton.ivanov
Cc: johannes, benjamin.berg, linux-um, linux-kernel, Chen Changcheng,
kernel test robot
cocci warnings: (new ones prefixed by >>)
>> arch/um/kernel/skas/stub_exe.c:180:23-24: WARNING: Use ARRAY_SIZE
Fixes: 406d17c6c370 ("um: Implement kernel side of SECCOMP based process handling")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202512080556.BbmGuwU4-lkp@intel.com/
Signed-off-by: Chen Changcheng <chenchangcheng@kylinos.cn>
---
arch/um/kernel/skas/stub_exe.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/um/kernel/skas/stub_exe.c b/arch/um/kernel/skas/stub_exe.c
index cbafaa684e66..01a938a5bb4f 100644
--- a/arch/um/kernel/skas/stub_exe.c
+++ b/arch/um/kernel/skas/stub_exe.c
@@ -193,7 +193,7 @@ noinline static void real_init(void)
BPF_STMT(BPF_RET | BPF_K, SECCOMP_RET_ALLOW),
};
struct sock_fprog prog = {
- .len = sizeof(filter) / sizeof(filter[0]),
+ .len = ARRAY_SIZE(filter),
.filter = filter,
};
--
2.25.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] um: use ARRAY_SIZE to calculate the length of an array
2025-12-08 2:37 [PATCH] um: use ARRAY_SIZE to calculate the length of an array Chen Changcheng
@ 2025-12-08 7:35 ` Johannes Berg
0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2025-12-08 7:35 UTC (permalink / raw)
To: Chen Changcheng, richard, anton.ivanov
Cc: benjamin.berg, linux-um, linux-kernel, kernel test robot
On Mon, 2025-12-08 at 10:37 +0800, Chen Changcheng wrote:
> cocci warnings: (new ones prefixed by >>)
> > > arch/um/kernel/skas/stub_exe.c:180:23-24: WARNING: Use ARRAY_SIZE
>
> Fixes: 406d17c6c370 ("um: Implement kernel side of SECCOMP based process handling")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202512080556.BbmGuwU4-lkp@intel.com/
Pro-tip: build your patches *before* submitting them and looking like an
idiot.
johannes
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-12-08 7:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-08 2:37 [PATCH] um: use ARRAY_SIZE to calculate the length of an array Chen Changcheng
2025-12-08 7:35 ` Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®