mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>
Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Nathan Chancellor <nathan@kernel.org>
Subject: [PATCH] RDMA/core: Remove _ib_copy_validate_udata_in() and _ib_respond_udata() stubs
Date: Tue, 19 May 2026 11:24:36 -0700	[thread overview]
Message-ID: <20260519-rdma-core-fix-ib_udata-redef-errors-v1-1-671bf2697fa5@kernel.org> (raw)

After commit 65b044cee9fb ("RDMA/core: Move the _ib_copy_validate_udata*
functions to ib_core_uverbs"), builds without INFINIBAND_USER_ACCESS
enabled fail with:

  drivers/infiniband/core/ib_core_uverbs.c:433:5: error: redefinition of '_ib_copy_validate_udata_in'
    433 | int _ib_copy_validate_udata_in(struct ib_udata *udata, void *req,
        |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
  In file included from include/rdma/uverbs_std_types.h:10,
                   from drivers/infiniband/core/uverbs.h:49,
                   from drivers/infiniband/core/ib_core_uverbs.c:10:
  include/rdma/uverbs_ioctl.h:961:19: note: previous definition of '_ib_copy_validate_udata_in' with type 'int(struct ib_udata *, void *, size_t,  size_t)' {aka 'int(struct ib_udata *, void *, long unsigned int,  long unsigned int)'}
    961 | static inline int _ib_copy_validate_udata_in(struct ib_udata *udata, void *req,
        |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~
  drivers/infiniband/core/ib_core_uverbs.c:483:5: error: redefinition of '_ib_respond_udata'
    483 | int _ib_respond_udata(struct ib_udata *udata, const void *src, size_t len)
        |     ^~~~~~~~~~~~~~~~~
  include/rdma/uverbs_ioctl.h:968:19: note: previous definition of '_ib_respond_udata' with type 'int(struct ib_udata *, const void *, size_t)' {aka 'int(struct ib_udata *, const void *, long unsigned int)'}
    968 | static inline int _ib_respond_udata(struct ib_udata *udata, const void *src,
        |                   ^~~~~~~~~~~~~~~~~

Remove the stubs and adjust the prototypes for _ib_respond_udata() and
_ib_copy_validate_udata_in(), as they will always be available when
INFINIBAND is enabled.

Fixes: 65b044cee9fb ("RDMA/core: Move the _ib_copy_validate_udata* functions to ib_core_uverbs")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 include/rdma/uverbs_ioctl.h | 21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)

diff --git a/include/rdma/uverbs_ioctl.h b/include/rdma/uverbs_ioctl.h
index e2af17da3e32..7cbdfc259738 100644
--- a/include/rdma/uverbs_ioctl.h
+++ b/include/rdma/uverbs_ioctl.h
@@ -856,6 +856,10 @@ ib_uverbs_get_ucontext(const struct uverbs_attr_bundle *attrs)
 	return ib_uverbs_get_ucontext_file(attrs->ufile);
 }
 
+int _ib_copy_validate_udata_in(struct ib_udata *udata, void *req,
+			       size_t kernel_size, size_t minimum_size);
+int _ib_respond_udata(struct ib_udata *udata, const void *src, size_t len);
+
 #if IS_ENABLED(CONFIG_INFINIBAND_USER_ACCESS)
 int uverbs_get_flags64(u64 *to, const struct uverbs_attr_bundle *attrs_bundle,
 		       size_t idx, u64 allowed_bits);
@@ -897,10 +901,6 @@ int _uverbs_get_const_unsigned(u64 *to,
 			       size_t idx, u64 upper_bound, u64 *def_val);
 int uverbs_copy_to_struct_or_zero(const struct uverbs_attr_bundle *bundle,
 				  size_t idx, const void *from, size_t size);
-
-int _ib_copy_validate_udata_in(struct ib_udata *udata, void *req,
-			       size_t kernel_size, size_t minimum_size);
-int _ib_respond_udata(struct ib_udata *udata, const void *src, size_t len);
 #else
 static inline int
 uverbs_get_flags64(u64 *to, const struct uverbs_attr_bundle *attrs_bundle,
@@ -957,19 +957,6 @@ _uverbs_get_const_unsigned(u64 *to,
 {
 	return -EINVAL;
 }
-
-static inline int _ib_copy_validate_udata_in(struct ib_udata *udata, void *req,
-					     size_t kernel_size,
-					     size_t minimum_size)
-{
-	return -EINVAL;
-}
-
-static inline int _ib_respond_udata(struct ib_udata *udata, const void *src,
-				    size_t len)
-{
-	return -EINVAL;
-}
 #endif
 
 #define uverbs_get_const_signed(_to, _attrs_bundle, _idx)                      \

---
base-commit: 65b044cee9fb117144f11ab68a318d0055cfbc1b
change-id: 20260519-rdma-core-fix-ib_udata-redef-errors-bce9d0c45f64

Best regards,
--  
Cheers,
Nathan


             reply	other threads:[~2026-05-19 18:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-19 18:24 Nathan Chancellor [this message]
2026-05-19 22:49 ` Jason Gunthorpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260519-rdma-core-fix-ib_udata-redef-errors-v1-1-671bf2697fa5@kernel.org \
    --to=nathan@kernel.org \
    --cc=jgg@ziepe.ca \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®