* [PATCH -next] RDMA/core: fix -Wunused-const-variable warnings
@ 2019-07-11 13:55 Qian Cai
2019-07-11 14:54 ` Jason Gunthorpe
0 siblings, 1 reply; 2+ messages in thread
From: Qian Cai @ 2019-07-11 13:55 UTC (permalink / raw)
To: jgg; +Cc: leonro, saeedm, talgi, yaminf, linux-rdma, linux-kernel, Qian Cai
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@lca.pw>
---
drivers/infiniband/core/cq.c | 13 +++++++++++++
include/linux/dim.h | 13 -------------
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/drivers/infiniband/core/cq.c b/drivers/infiniband/core/cq.c
index ffd6e24109d5..7c599878ccf7 100644
--- a/drivers/infiniband/core/cq.c
+++ b/drivers/infiniband/core/cq.c
@@ -18,6 +18,19 @@
#define IB_POLL_FLAGS \
(IB_CQ_NEXT_COMP | IB_CQ_REPORT_MISSED_EVENTS)
+static const struct dim_cq_moder
+rdma_dim_prof[RDMA_DIM_PARAMS_NUM_PROFILES] = {
+ {1, 0, 1, 0},
+ {1, 0, 4, 0},
+ {2, 0, 4, 0},
+ {2, 0, 8, 0},
+ {4, 0, 8, 0},
+ {16, 0, 8, 0},
+ {16, 0, 16, 0},
+ {32, 0, 16, 0},
+ {32, 0, 32, 0},
+};
+
static void ib_cq_rdma_dim_work(struct work_struct *w)
{
struct dim *dim = container_of(w, struct dim, work);
diff --git a/include/linux/dim.h b/include/linux/dim.h
index aa69730c3b8d..d3a0fbfff2bb 100644
--- a/include/linux/dim.h
+++ b/include/linux/dim.h
@@ -374,19 +374,6 @@ void dim_calc_stats(struct dim_sample *start, struct dim_sample *end,
#define RDMA_DIM_PARAMS_NUM_PROFILES 9
#define RDMA_DIM_START_PROFILE 0
-static const struct dim_cq_moder
-rdma_dim_prof[RDMA_DIM_PARAMS_NUM_PROFILES] = {
- {1, 0, 1, 0},
- {1, 0, 4, 0},
- {2, 0, 4, 0},
- {2, 0, 8, 0},
- {4, 0, 8, 0},
- {16, 0, 8, 0},
- {16, 0, 16, 0},
- {32, 0, 16, 0},
- {32, 0, 32, 0},
-};
-
/**
* rdma_dim - Runs the adaptive moderation.
* @dim: The moderation struct.
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] RDMA/core: fix -Wunused-const-variable warnings
2019-07-11 13:55 [PATCH -next] RDMA/core: fix -Wunused-const-variable warnings Qian Cai
@ 2019-07-11 14:54 ` Jason Gunthorpe
0 siblings, 0 replies; 2+ messages in thread
From: Jason Gunthorpe @ 2019-07-11 14:54 UTC (permalink / raw)
To: Qian Cai; +Cc: leonro, saeedm, talgi, yaminf, linux-rdma, linux-kernel
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@lca.pw>
> ---
> drivers/infiniband/core/cq.c | 13 +++++++++++++
> include/linux/dim.h | 13 -------------
> 2 files changed, 13 insertions(+), 13 deletions(-)
Applied to for-next, thanks
Jason
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-07-11 14:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-11 13:55 [PATCH -next] RDMA/core: fix -Wunused-const-variable warnings Qian Cai
2019-07-11 14:54 ` 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).