Commit 00e31cfc authored by Rahul Lakkireddy's avatar Rahul Lakkireddy Committed by David S. Miller

cxgb4: fix set but unused variable when DCB is disabled

Remove the set but unused variable when DCB is disabled. Instead,
do the calculation directly inline.

Fixes following warning in make W=1:
cxgb4_main.c: In function 'cfg_queues':
cxgb4_main.c:5380:29: warning: variable 'n1g' set but not used
[-Wunused-but-set-variable]
  u32 i, n10g = 0, qidx = 0, n1g = 0;
                             ^

Fixes: 116ca924 ("cxgb4: fix checks for max queues to allocate")
Signed-off-by: default avatarRahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bab3bcf3
...@@ -5377,10 +5377,10 @@ static inline bool is_x_10g_port(const struct link_config *lc) ...@@ -5377,10 +5377,10 @@ static inline bool is_x_10g_port(const struct link_config *lc)
static int cfg_queues(struct adapter *adap) static int cfg_queues(struct adapter *adap)
{ {
u32 avail_qsets, avail_eth_qsets, avail_uld_qsets; u32 avail_qsets, avail_eth_qsets, avail_uld_qsets;
u32 i, n10g = 0, qidx = 0, n1g = 0;
u32 ncpus = num_online_cpus(); u32 ncpus = num_online_cpus();
u32 niqflint, neq, num_ulds; u32 niqflint, neq, num_ulds;
struct sge *s = &adap->sge; struct sge *s = &adap->sge;
u32 i, n10g = 0, qidx = 0;
u32 q10g = 0, q1g; u32 q10g = 0, q1g;
/* Reduce memory usage in kdump environment, disable all offload. */ /* Reduce memory usage in kdump environment, disable all offload. */
...@@ -5426,7 +5426,6 @@ static int cfg_queues(struct adapter *adap) ...@@ -5426,7 +5426,6 @@ static int cfg_queues(struct adapter *adap)
if (n10g) if (n10g)
q10g = (avail_eth_qsets - (adap->params.nports - n10g)) / n10g; q10g = (avail_eth_qsets - (adap->params.nports - n10g)) / n10g;
n1g = adap->params.nports - n10g;
#ifdef CONFIG_CHELSIO_T4_DCB #ifdef CONFIG_CHELSIO_T4_DCB
/* For Data Center Bridging support we need to be able to support up /* For Data Center Bridging support we need to be able to support up
* to 8 Traffic Priorities; each of which will be assigned to its * to 8 Traffic Priorities; each of which will be assigned to its
...@@ -5444,7 +5443,8 @@ static int cfg_queues(struct adapter *adap) ...@@ -5444,7 +5443,8 @@ static int cfg_queues(struct adapter *adap)
else else
q10g = max(8U, q10g); q10g = max(8U, q10g);
while ((q10g * n10g) > (avail_eth_qsets - n1g * q1g)) while ((q10g * n10g) >
(avail_eth_qsets - (adap->params.nports - n10g) * q1g))
q10g--; q10g--;
#else /* !CONFIG_CHELSIO_T4_DCB */ #else /* !CONFIG_CHELSIO_T4_DCB */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment