Skip to content

Commit e2c69f3

Browse files
arndbAlexei Starovoitov
authored andcommitted
bpf: Avoid old-style declaration warnings
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: 3f6719c ("bpf: Add bpf_bprm_opts_set helper") Fixes: 27672f0 ("bpf: Add a BPF helper for getting the IMA hash of an inode") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: KP Singh <kpsingh@kernel.org> Link: https://lore.kernel.org/bpf/20210322215201.1097281-1-arnd@kernel.org
1 parent 78b226d commit e2c69f3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/bpf/bpf_lsm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ BPF_CALL_2(bpf_bprm_opts_set, struct linux_binprm *, bprm, u64, flags)
6767

6868
BTF_ID_LIST_SINGLE(bpf_bprm_opts_set_btf_ids, struct, linux_binprm)
6969

70-
const static struct bpf_func_proto bpf_bprm_opts_set_proto = {
70+
static const struct bpf_func_proto bpf_bprm_opts_set_proto = {
7171
.func = bpf_bprm_opts_set,
7272
.gpl_only = false,
7373
.ret_type = RET_INTEGER,
@@ -88,7 +88,7 @@ static bool bpf_ima_inode_hash_allowed(const struct bpf_prog *prog)
8888

8989
BTF_ID_LIST_SINGLE(bpf_ima_inode_hash_btf_ids, struct, inode)
9090

91-
const static struct bpf_func_proto bpf_ima_inode_hash_proto = {
91+
static const struct bpf_func_proto bpf_ima_inode_hash_proto = {
9292
.func = bpf_ima_inode_hash,
9393
.gpl_only = false,
9494
.ret_type = RET_INTEGER,

0 commit comments

Comments
 (0)