From: Chen Changcheng <chenchangcheng@kylinos.cn>
To: richard@nod.at, anton.ivanov@cambridgegreys.com
Cc: johannes@sipsolutions.net, benjamin.berg@intel.com,
linux-um@lists.infradead.org, linux-kernel@vger.kernel.org,
Chen Changcheng <chenchangcheng@kylinos.cn>,
kernel test robot <lkp@intel.com>
Subject: [PATCH] um: use ARRAY_SIZE to calculate the length of an array
Date: Mon, 8 Dec 2025 10:37:23 +0800 [thread overview]
Message-ID: <20251208023723.19789-1-chenchangcheng@kylinos.cn> (raw)
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
next reply other threads:[~2025-12-08 2:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-08 2:37 Chen Changcheng [this message]
2025-12-08 7:35 ` Johannes Berg
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=20251208023723.19789-1-chenchangcheng@kylinos.cn \
--to=chenchangcheng@kylinos.cn \
--cc=anton.ivanov@cambridgegreys.com \
--cc=benjamin.berg@intel.com \
--cc=johannes@sipsolutions.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-um@lists.infradead.org \
--cc=lkp@intel.com \
--cc=richard@nod.at \
/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 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®