Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

Fixes: 2904bb37b35d ("IB/core: Split uverbs_get_const/default to consider target type")
Link: https://lore.kernel.org/r/20210401021028.25720-1-yuehaibing@huawei.com
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>

authored by

YueHaibing and committed by
Jason Gunthorpe
dbb3e9db f91696f2

+4 -3
+4 -3
include/rdma/uverbs_ioctl.h
··· 926 926 { 927 927 return -EINVAL; 928 928 } 929 - static int 930 - _uverbs_get_const_signed(s64 *to, const struct uverbs_attr_bundle *attrs_bundle, 929 + static inline int 930 + _uverbs_get_const_signed(s64 *to, 931 + const struct uverbs_attr_bundle *attrs_bundle, 931 932 size_t idx, s64 lower_bound, u64 upper_bound, 932 933 s64 *def_val) 933 934 { 934 935 return -EINVAL; 935 936 } 936 - static int 937 + static inline int 937 938 _uverbs_get_const_unsigned(u64 *to, 938 939 const struct uverbs_attr_bundle *attrs_bundle, 939 940 size_t idx, u64 upper_bound, u64 *def_val)