Skip to contentSkip to conversation

RDMA/uverbs: Fix -Wunused-function warning

PATCH Applied YueHaibing 3 participants 3 messages Apr 1, 2021 InfiniBand

lore
Share & tools
lore

YueHaibing

author
#0 lore raw

PATCH 1/1 RDMA/uverbs: Fix -Wunused-function warning

make W=1 warns this:

In file included from drivers/infiniband/sw/rdmavt/mmap.c:51:0:
./include/rdma/uverbs_ioctl.h:937:1:
warning: ‘_uverbs_get_const_unsigned’ defined but not used [-Wunused-function] _uverbs_get_const_unsigned(u64 *to,
^~~~~~~~~~~~~~~~~~~~~~~~~~
./include/rdma/uverbs_ioctl.h:930:1:
warning: ‘_uverbs_get_const_signed’ defined but not used [-Wunused-function] _uverbs_get_const_signed(s64 *to, const struct uverbs_attr_bundle *attrs_bundle, ^~~~~~~~~~~~~~~~~~~~~~~~

Make these functions inline to fix this warnings.

---
 include/rdma/uverbs_ioctl.h | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
include/rdma/uverbs_ioctl.h +4 -3
index 3829b6ef4bb6..23bb404aba12 100644
@@ -926,14 +926,15 @@ uverbs_copy_to_struct_or_zero(const struct uverbs_attr_bundle *bundle,
 {
 	return -EINVAL;
 }
-static int
-_uverbs_get_const_signed(s64 *to, const struct uverbs_attr_bundle *attrs_bundle,
+static inline int
+_uverbs_get_const_signed(s64 *to,
+			 const struct uverbs_attr_bundle *attrs_bundle,
 			 size_t idx, s64 lower_bound, u64 upper_bound,
 			 s64 *def_val)
 {
 	return -EINVAL;
 }
-static int
+static inline int
 _uverbs_get_const_unsigned(u64 *to,
 			   const struct uverbs_attr_bundle *attrs_bundle,
 			   size_t idx, u64 upper_bound, u64 *def_val)
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 12 lines · YueHaibing

make W=1 warns this:

In file included from drivers/infiniband/sw/rdmavt/mmap.c:51:0:
./include/rdma/uverbs_ioctl.h:937:1:
warning: ‘_uverbs_get_const_unsigned’ defined but not used [-Wunused-function] _uverbs_get_const_unsigned(u64 *to,
^~~~~~~~~~~~~~~~~~~~~~~~~~
./include/rdma/uverbs_ioctl.h:930:1:
warning: ‘_uverbs_get_const_signed’ defined but not used [-Wunused-function] _uverbs_get_const_signed(s64 *to, const struct uverbs_attr_bundle *attrs_bundle, ^~~~~~~~~~~~~~~~~~~~~~~~

Quoted 7 lines

Make these functions inline to fix this warnings.

---
 include/rdma/uverbs_ioctl.h | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Thanks,

maintainer Applied
#2 lore raw
In reply to YueHaibing
Quoted 12 lines · YueHaibing

make W=1 warns this:

In file included from drivers/infiniband/sw/rdmavt/mmap.c:51:0:
./include/rdma/uverbs_ioctl.h:937:1:
warning: ‘_uverbs_get_const_unsigned’ defined but not used [-Wunused-function] _uverbs_get_const_unsigned(u64 *to,
^~~~~~~~~~~~~~~~~~~~~~~~~~
./include/rdma/uverbs_ioctl.h:930:1:
warning: ‘_uverbs_get_const_signed’ defined but not used [-Wunused-function] _uverbs_get_const_signed(s64 *to, const struct uverbs_attr_bundle *attrs_bundle, ^~~~~~~~~~~~~~~~~~~~~~~~

Quoted 6 lines

Make these functions inline to fix this warnings.

---
 include/rdma/uverbs_ioctl.h | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Applied to for-next

I added

Fixes 2904bb37b35d ("IB/core: Split uverbs_get_const/default to consider target type")

Jason