[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <ead27aa92275c71c1fcd148f88ca6926a524f322.1764843951.git.geert@linux-m68k.org>
Date: Thu, 4 Dec 2025 11:29:15 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Kui-Feng Lee <thinker.li@...il.com>,
Martin KaFai Lau <martin.lau@...ux.dev>,
"D . Wythe" <alibuda@...ux.alibaba.com>,
Dust Li <dust.li@...ux.alibaba.com>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
John Fastabend <john.fastabend@...il.com>,
Sidraya Jayagond <sidraya@...ux.ibm.com>,
Wenjia Zhang <wenjia@...ux.ibm.com>,
Mahanta Jambigi <mjambigi@...ux.ibm.com>,
Tony Lu <tonylu@...ux.alibaba.com>,
Wen Gu <guwen@...ux.alibaba.com>,
"David S . Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Simon Horman <horms@...nel.org>
Cc: bpf@...r.kernel.org,
linux-rdma@...r.kernel.org,
linux-s390@...r.kernel.org,
netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
Geert Uytterhoeven <geert@...ux-m68k.org>
Subject: [PATCH 1/2] bpf: Fix register_bpf_struct_ops() dummy
If CONFIG_BPF_SYSCALL=y, but CONFIG_BPF_JIT=n:
net/smc/smc_hs_bpf.c: In function ‘bpf_smc_hs_ctrl_init’:
include/linux/bpf.h:2068:50: error: statement with no effect [-Werror=unused-value]
2068 | #define register_bpf_struct_ops(st_ops, type) ({ (void *)(st_ops); 0; })
| ^~~~~~~~~~~~~~~~
net/smc/smc_hs_bpf.c:139:16: note: in expansion of macro ‘register_bpf_struct_ops’
139 | return register_bpf_struct_ops(&bpf_smc_hs_ctrl_ops, smc_hs_ctrl);
| ^~~~~~~~~~~~~~~~~~~~~~~
As type is not a variable, but a variable type, this cannot be fixed by
just converting register_bpf_struct_ops() into a static inline function.
Hence fix this by introducing a static inline intermediate dummy.
Fixes: f6be98d19985411c ("bpf, net: switch to dynamic registration")
Signed-off-by: Geert Uytterhoeven <geert@...ux-m68k.org>
---
include/linux/bpf.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 6498be4c44f8c275..bb69905c28a761e7 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -2065,7 +2065,11 @@ int bpf_struct_ops_desc_init(struct bpf_struct_ops_desc *st_ops_desc,
void bpf_map_struct_ops_info_fill(struct bpf_map_info *info, struct bpf_map *map);
void bpf_struct_ops_desc_release(struct bpf_struct_ops_desc *st_ops_desc);
#else
-#define register_bpf_struct_ops(st_ops, type) ({ (void *)(st_ops); 0; })
+static inline int __register_bpf_struct_ops(struct bpf_struct_ops *st_ops)
+{
+ return 0;
+}
+#define register_bpf_struct_ops(st_ops, type) __register_bpf_struct_ops(st_ops)
static inline bool bpf_try_module_get(const void *data, struct module *owner)
{
return try_module_get(owner);
--
2.43.0
Powered by blists - more mailing lists