* [PATCH rdma-next] RDMA/mlx5: Fix compilation warning when USER_ACCESS isn't set
@ 2025-04-02 7:09 Mark Bloch
2025-04-03 10:08 ` Arnd Bergmann
2025-04-07 18:18 ` Jason Gunthorpe
0 siblings, 2 replies; 3+ messages in thread
From: Mark Bloch @ 2025-04-02 7:09 UTC (permalink / raw)
To: Jason Gunthorpe, Leon Romanovsky
Cc: Arnd Bergmann, Patrisious Haddad, linux-rdma, Mark Bloch
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.
Fixes: 36e0d433672f ("RDMA/mlx5: Compile fs.c regardless of INFINIBAND_USER_ACCESS config")
Signed-off-by: Mark Bloch <mbloch@nvidia.com>
---
drivers/infiniband/hw/mlx5/fs.c | 2 --
include/rdma/ib_verbs.h | 7 +++++++
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/mlx5/fs.c b/drivers/infiniband/hw/mlx5/fs.c
index 251246c73b33..0ff9f18a71e8 100644
--- a/drivers/infiniband/hw/mlx5/fs.c
+++ b/drivers/infiniband/hw/mlx5/fs.c
@@ -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
{},
};
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index d42eae69d9a8..901353796fbb 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -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,
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH rdma-next] RDMA/mlx5: Fix compilation warning when USER_ACCESS isn't set
2025-04-02 7:09 [PATCH rdma-next] RDMA/mlx5: Fix compilation warning when USER_ACCESS isn't set Mark Bloch
@ 2025-04-03 10:08 ` Arnd Bergmann
2025-04-07 18:18 ` Jason Gunthorpe
1 sibling, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2025-04-03 10:08 UTC (permalink / raw)
To: Mark Bloch, Jason Gunthorpe, Leon Romanovsky
Cc: Patrisious Haddad, linux-rdma
On Wed, Apr 2, 2025, at 09:09, Mark Bloch wrote:
> 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.
>
> Fixes: 36e0d433672f ("RDMA/mlx5: Compile fs.c regardless of
> INFINIBAND_USER_ACCESS config")
> Signed-off-by: Mark Bloch <mbloch@nvidia.com>
I've tested this on my randconfig build machine for a day now,
and saw no other problems with it.
Tested-by: Arnd Bergmann <arnd@arndb.de>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH rdma-next] RDMA/mlx5: Fix compilation warning when USER_ACCESS isn't set
2025-04-02 7:09 [PATCH rdma-next] RDMA/mlx5: Fix compilation warning when USER_ACCESS isn't set Mark Bloch
2025-04-03 10:08 ` Arnd Bergmann
@ 2025-04-07 18:18 ` Jason Gunthorpe
1 sibling, 0 replies; 3+ messages in thread
From: Jason Gunthorpe @ 2025-04-07 18:18 UTC (permalink / raw)
To: Mark Bloch; +Cc: Leon Romanovsky, Arnd Bergmann, Patrisious Haddad, linux-rdma
On Wed, Apr 02, 2025 at 10:09:44AM +0300, Mark Bloch wrote:
> 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.
>
> Fixes: 36e0d433672f ("RDMA/mlx5: Compile fs.c regardless of INFINIBAND_USER_ACCESS config")
> Signed-off-by: Mark Bloch <mbloch@nvidia.com>
> Tested-by: Arnd Bergmann <arnd@arndb.de>
> ---
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-04-07 18:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-02 7:09 [PATCH rdma-next] RDMA/mlx5: Fix compilation warning when USER_ACCESS isn't set Mark Bloch
2025-04-03 10:08 ` Arnd Bergmann
2025-04-07 18:18 ` Jason Gunthorpe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).