Skip to content

Commit 00e31cf

Browse files
chelsiocudbgdavem330
authored andcommitted
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: 116ca92 ("cxgb4: fix checks for max queues to allocate") Signed-off-by: Rahul Lakkireddy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent bab3bcf commit 00e31cf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5377,10 +5377,10 @@ static inline bool is_x_10g_port(const struct link_config *lc)
53775377
static int cfg_queues(struct adapter *adap)
53785378
{
53795379
u32 avail_qsets, avail_eth_qsets, avail_uld_qsets;
5380-
u32 i, n10g = 0, qidx = 0, n1g = 0;
53815380
u32 ncpus = num_online_cpus();
53825381
u32 niqflint, neq, num_ulds;
53835382
struct sge *s = &adap->sge;
5383+
u32 i, n10g = 0, qidx = 0;
53845384
u32 q10g = 0, q1g;
53855385

53865386
/* Reduce memory usage in kdump environment, disable all offload. */
@@ -5426,7 +5426,6 @@ static int cfg_queues(struct adapter *adap)
54265426
if (n10g)
54275427
q10g = (avail_eth_qsets - (adap->params.nports - n10g)) / n10g;
54285428

5429-
n1g = adap->params.nports - n10g;
54305429
#ifdef CONFIG_CHELSIO_T4_DCB
54315430
/* For Data Center Bridging support we need to be able to support up
54325431
* to 8 Traffic Priorities; each of which will be assigned to its
@@ -5444,7 +5443,8 @@ static int cfg_queues(struct adapter *adap)
54445443
else
54455444
q10g = max(8U, q10g);
54465445

5447-
while ((q10g * n10g) > (avail_eth_qsets - n1g * q1g))
5446+
while ((q10g * n10g) >
5447+
(avail_eth_qsets - (adap->params.nports - n10g) * q1g))
54485448
q10g--;
54495449

54505450
#else /* !CONFIG_CHELSIO_T4_DCB */

0 commit comments

Comments
 (0)