diff --git a/include/linux/bpf.h b/include/linux/bpf.h index 6498be4c44f8..eca6966d4f87 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h @@ -2065,7 +2065,7 @@ 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; }) +#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); diff --git a/include/linux/btf.h b/include/linux/btf.h index f06976ffb63f..799a75209536 100644 --- a/include/linux/btf.h +++ b/include/linux/btf.h @@ -535,6 +535,11 @@ int __register_bpf_struct_ops(struct bpf_struct_ops *st_ops); const struct bpf_struct_ops_desc *bpf_struct_ops_find_value(struct btf *btf, u32 value_id); const struct bpf_struct_ops_desc *bpf_struct_ops_find(struct btf *btf, u32 type_id); #else +struct bpf_struct_ops; +static inline int __register_bpf_struct_ops(struct bpf_struct_ops *st_ops) +{ + return 0; +} static inline const struct bpf_struct_ops_desc *bpf_struct_ops_find(struct btf *btf, u32 type_id) { return NULL;