Re: [PATCH -next] RDMA/core: fix -Wunused-const-variable warnings

From: Jason Gunthorpe
Date: Thu Jul 11 2019 - 10:54:08 EST


On Thu, Jul 11, 2019 at 09:55:56AM -0400, Qian Cai wrote:
> The linux-next commit "linux/dim: Implement RDMA adaptive moderation
> (DIM)" [1] introduced a few compilation warnings.
>
> In file included from ./include/rdma/ib_verbs.h:64,
> from ./include/linux/mlx5/device.h:37,
> from ./include/linux/mlx5/driver.h:51,
> from drivers/net/ethernet/mellanox/mlx5/core/uar.c:36:
> ./include/linux/dim.h:378:1: warning: 'rdma_dim_prof' defined but not
> used [-Wunused-const-variable=]
> rdma_dim_prof[RDMA_DIM_PARAMS_NUM_PROFILES] = {
> ^~~~~~~~~~~~~
> In file included from ./include/rdma/ib_verbs.h:64,
> from ./include/linux/mlx5/device.h:37,
> from ./include/linux/mlx5/driver.h:51,
> from
> drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c:37:
> ./include/linux/dim.h:378:1: warning: 'rdma_dim_prof' defined but not
> used [-Wunused-const-variable=]
> rdma_dim_prof[RDMA_DIM_PARAMS_NUM_PROFILES] = {
> ^~~~~~~~~~~~~
>
> Since only ib_cq_rdma_dim_work() in drivers/infiniband/core/cq.c uses
> it, just move the definition over there.
>
> [1] https://patchwork.kernel.org/patch/11031455/
>
> Signed-off-by: Qian Cai <cai@xxxxxx>
> ---
> drivers/infiniband/core/cq.c | 13 +++++++++++++
> include/linux/dim.h | 13 -------------
> 2 files changed, 13 insertions(+), 13 deletions(-)

Applied to for-next, thanks

Jason