linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] RDMA/uverbs: Fix -Wunused-function warning
@ 2021-04-01  2:10 YueHaibing
  2021-04-01 12:14 ` Leon Romanovsky
  2021-04-01 18:30 ` Jason Gunthorpe
  0 siblings, 2 replies; 3+ messages in thread
From: YueHaibing @ 2021-04-01  2:10 UTC (permalink / raw)
  To: dledford, jgg; +Cc: linux-rdma, linux-kernel, 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,
 ^~~~~~~~~~~~~~~~~~~~~~~~

Make these functions inline to fix this warnings.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 include/rdma/uverbs_ioctl.h | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/include/rdma/uverbs_ioctl.h b/include/rdma/uverbs_ioctl.h
index 3829b6ef4bb6..23bb404aba12 100644
--- a/include/rdma/uverbs_ioctl.h
+++ b/include/rdma/uverbs_ioctl.h
@@ -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)
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] RDMA/uverbs: Fix -Wunused-function warning
  2021-04-01  2:10 [PATCH -next] RDMA/uverbs: Fix -Wunused-function warning YueHaibing
@ 2021-04-01 12:14 ` Leon Romanovsky
  2021-04-01 18:30 ` Jason Gunthorpe
  1 sibling, 0 replies; 3+ messages in thread
From: Leon Romanovsky @ 2021-04-01 12:14 UTC (permalink / raw)
  To: YueHaibing; +Cc: dledford, jgg, linux-rdma, linux-kernel

On Thu, Apr 01, 2021 at 10:10:28AM +0800, YueHaibing wrote:
> 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.
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  include/rdma/uverbs_ioctl.h | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 

Thanks,
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] RDMA/uverbs: Fix -Wunused-function warning
  2021-04-01  2:10 [PATCH -next] RDMA/uverbs: Fix -Wunused-function warning YueHaibing
  2021-04-01 12:14 ` Leon Romanovsky
@ 2021-04-01 18:30 ` Jason Gunthorpe
  1 sibling, 0 replies; 3+ messages in thread
From: Jason Gunthorpe @ 2021-04-01 18:30 UTC (permalink / raw)
  To: YueHaibing; +Cc: dledford, linux-rdma, linux-kernel

On Thu, Apr 01, 2021 at 10:10:28AM +0800, YueHaibing wrote:
> 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.
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-01 18:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-01  2:10 [PATCH -next] RDMA/uverbs: Fix -Wunused-function warning YueHaibing
2021-04-01 12:14 ` Leon Romanovsky
2021-04-01 18:30 ` 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).