* [PATCH] bpf: avoid old-style declaration warnings
@ 2021-03-22 21:51 Arnd Bergmann
2021-03-23 0:12 ` KP Singh
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2021-03-22 21:51 UTC (permalink / raw)
To: KP Singh, Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
Martin KaFai Lau, Yonghong Song
Cc: Arnd Bergmann, Florent Revest, Brendan Jackman, Song Liu,
John Fastabend, Mikko Ylinen, Jiri Olsa, bpf, netdev,
linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
gcc -Wextra wants type modifiers in the normal order:
kernel/bpf/bpf_lsm.c:70:1: error: 'static' is not at beginning of declaration [-Werror=old-style-declaration]
70 | const static struct bpf_func_proto bpf_bprm_opts_set_proto = {
| ^~~~~
kernel/bpf/bpf_lsm.c:91:1: error: 'static' is not at beginning of declaration [-Werror=old-style-declaration]
91 | const static struct bpf_func_proto bpf_ima_inode_hash_proto = {
| ^~~~~
Fixes: 3f6719c7b62f ("bpf: Add bpf_bprm_opts_set helper")
Fixes: 27672f0d280a ("bpf: Add a BPF helper for getting the IMA hash of an inode")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
kernel/bpf/bpf_lsm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/bpf/bpf_lsm.c b/kernel/bpf/bpf_lsm.c
index 1622a44d1617..75b1c678d558 100644
--- a/kernel/bpf/bpf_lsm.c
+++ b/kernel/bpf/bpf_lsm.c
@@ -67,7 +67,7 @@ BPF_CALL_2(bpf_bprm_opts_set, struct linux_binprm *, bprm, u64, flags)
BTF_ID_LIST_SINGLE(bpf_bprm_opts_set_btf_ids, struct, linux_binprm)
-const static struct bpf_func_proto bpf_bprm_opts_set_proto = {
+static const struct bpf_func_proto bpf_bprm_opts_set_proto = {
.func = bpf_bprm_opts_set,
.gpl_only = false,
.ret_type = RET_INTEGER,
@@ -88,7 +88,7 @@ static bool bpf_ima_inode_hash_allowed(const struct bpf_prog *prog)
BTF_ID_LIST_SINGLE(bpf_ima_inode_hash_btf_ids, struct, inode)
-const static struct bpf_func_proto bpf_ima_inode_hash_proto = {
+static const struct bpf_func_proto bpf_ima_inode_hash_proto = {
.func = bpf_ima_inode_hash,
.gpl_only = false,
.ret_type = RET_INTEGER,
--
2.29.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] bpf: avoid old-style declaration warnings
2021-03-22 21:51 [PATCH] bpf: avoid old-style declaration warnings Arnd Bergmann
@ 2021-03-23 0:12 ` KP Singh
0 siblings, 0 replies; 2+ messages in thread
From: KP Singh @ 2021-03-23 0:12 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
Martin KaFai Lau, Yonghong Song, Arnd Bergmann, Florent Revest,
Brendan Jackman, Song Liu, John Fastabend, Mikko Ylinen,
Jiri Olsa, bpf, Networking, open list
On Mon, Mar 22, 2021 at 10:52 PM Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> gcc -Wextra wants type modifiers in the normal order:
>
> kernel/bpf/bpf_lsm.c:70:1: error: 'static' is not at beginning of declaration [-Werror=old-style-declaration]
> 70 | const static struct bpf_func_proto bpf_bprm_opts_set_proto = {
> | ^~~~~
> kernel/bpf/bpf_lsm.c:91:1: error: 'static' is not at beginning of declaration [-Werror=old-style-declaration]
> 91 | const static struct bpf_func_proto bpf_ima_inode_hash_proto = {
> | ^~~~~
>
> Fixes: 3f6719c7b62f ("bpf: Add bpf_bprm_opts_set helper")
> Fixes: 27672f0d280a ("bpf: Add a BPF helper for getting the IMA hash of an inode")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Thanks for fixing!
Acked-by: KP Singh <kpsingh@kernel.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-03-23 0:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-22 21:51 [PATCH] bpf: avoid old-style declaration warnings Arnd Bergmann
2021-03-23 0:12 ` KP Singh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox