RDMA/mlx5: Fix compilation warning when USER_ACCESS isn't set
Subsystems (2)
PATCH 1/1 RDMA/mlx5: Fix compilation warning when USER_ACCESS isn't set
The cited commit made fs.c always compile, even when INFINIBAND_USER_ACCESS isn't set. This results in a compilation warning about an unused object when compiling with W=1 and USER_ACCESS is unset.
Fix this by defining uverbs_destroy_def_handler() even when USER_ACCESS isn't set.
--- drivers/infiniband/hw/mlx5/fs.c | 2 -- include/rdma/ib_verbs.h | 7 +++++++ 2 files changed, 7 insertions(+), 2 deletions(-)
drivers/infiniband/hw/mlx5/fs.c +0 -2
@@ -3461,7 +3461,6 @@ DECLARE_UVERBS_NAMED_OBJECT( &UVERBS_METHOD(MLX5_IB_METHOD_STEERING_ANCHOR_DESTROY));const struct uapi_definition mlx5_ib_flow_defs[] = { -#if IS_ENABLED(CONFIG_INFINIBAND_USER_ACCESS)UAPI_DEF_CHAIN_OBJ_TREE_NAMED (MLX5_IB_OBJECT_FLOW_MATCHER ), UAPI_DEF_CHAIN_OBJ_TREE(
@@ -3472,7 +3471,6 @@ const struct uapi_definition mlx5_ib_flow_defs[] = {UAPI_DEF_CHAIN_OBJ_TREE_NAMED (MLX5_IB_OBJECT_STEERING_ANCHOR , UAPI_DEF_IS_OBJ_SUPPORTED(mlx5_ib_shared_ft_allowed)), -#endif {}, };
include/rdma/ib_verbs.h +7 -0
@@ -4790,7 +4790,14 @@ void roce_del_all_netdev_gids(struct ib_device *ib_dev,struct ib_ucontext *ib_uverbs_get_ucontext_file (struct ib_uverbs_file *ufile); +#if IS_ENABLED (CONFIG_INFINIBAND_USER_ACCESS )int uverbs_destroy_def_handler (struct uverbs_attr_bundle *attrs); +#else +static inline int uverbs_destroy_def_handler (struct uverbs_attr_bundle *attrs) +{ +return 0 ; +} +#endif struct net_device *rdma_alloc_netdev(struct ib_device *device, u32 port_num, enum rdma_netdev_t type, const char *name,
Signature · 1 line
2.34.1
Quoted 11 lines · Mark Bloch
The cited commit made
fs.calways compile, even whenINFINIBAND_USER_ACCESSisn't set. This results in a compilation warning about an unused object when compiling with W=1 andUSER_ACCESSis unset.Fix this by defining
uverbs_destroy_def_handler()even whenUSER_ACCESSisn't set.Fixes 36e0d433672f ("RDMA/mlx5: Compile fs.c regardless of
INFINIBAND_USER_ACCESSconfig")Signed-off-by Mark Bloch <[email protected]>
I've tested this on my randconfig build machine for a day now, and saw no other problems with it.
Quoted 8 lines · Mark Bloch
The cited commit made
fs.calways compile, even whenINFINIBAND_USER_ACCESSisn't set. This results in a compilation warning about an unused object when compiling with W=1 andUSER_ACCESSis unset.Fix this by defining
uverbs_destroy_def_handler()even whenUSER_ACCESSisn't set.
Quoted 7 lines
Fixes 36e0d433672f ("RDMA/mlx5: Compile fs.c regardless of INFINIBAND_USER_ACCESS config")Signed-off-by Mark Bloch <[email protected]>Tested-by Arnd Bergmann <[email protected]>--- drivers/infiniband/hw/mlx5/fs.c | 2 -- include/rdma/ib_verbs.h | 7 +++++++ 2 files changed, 7 insertions(+), 2 deletions(-)
Applied to for-rc, thanks
Jason