[PATCH bpf-next] bpf: clean up for 'const static' in bpf_lsm.c

Subsystems: bpf [general] (safe dynamic programs and tools), bpf [security & lsm] (security audit and enforcement using bpf), the rest

STALE2013d

2 messages, 2 authors, 2021-02-05 · open the first message on its own page

[PATCH bpf-next] bpf: clean up for 'const static' in bpf_lsm.c

From: Xu Jia <hidden>
Date: 2021-02-05 01:40:53

Prefer 'static const' over 'const static' here

Signed-off-by: Xu Jia <redacted>
---
 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.22.0

Re: [PATCH bpf-next] bpf: clean up for 'const static' in bpf_lsm.c

From: Alexei Starovoitov <hidden>
Date: 2021-02-05 01:48:08

On Thu, Feb 4, 2021 at 5:40 PM Xu Jia [off-list ref] wrote:
quoted hunk
Prefer 'static const' over 'const static' here

Signed-off-by: Xu Jia <redacted>
---
 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 = {
I totally agree that it's more canonical this way, but I don't think
such git history noise
is worth it.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help