Skip to content

Commit b9fd988

Browse files
JasonXingdavem330
authored andcommitted
bnxt_en: eliminate the compile warning in bnxt_request_irq due to CONFIG_RFS_ACCEL
I received a kernel-test-bot report[1] that shows the [-Wunused-but-set-variable] warning. Since the previous commit I made, as the 'Fixes' tag shows, gives users an option to turn on and off the CONFIG_RFS_ACCEL, the issue then can be discovered and reproduced with GCC specifically. Like Simon and Jakub suggested, use fewer #ifdefs which leads to fewer bugs. [1] All warnings (new ones prefixed by >>): drivers/net/ethernet/broadcom/bnxt/bnxt.c: In function 'bnxt_request_irq': >> drivers/net/ethernet/broadcom/bnxt/bnxt.c:10703:9: warning: variable 'j' set but not used [-Wunused-but-set-variable] 10703 | int i, j, rc = 0; | ^ Fixes: 9b6a30f ("net: allow rps/rfs related configs to be switched") Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Signed-off-by: Jason Xing <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 17bbde2 commit b9fd988

File tree

1 file changed

+4
-6
lines changed
  • drivers/net/ethernet/broadcom/bnxt

1 file changed

+4
-6
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11607,11 +11607,9 @@ static void bnxt_free_irq(struct bnxt *bp)
1160711607

1160811608
static int bnxt_request_irq(struct bnxt *bp)
1160911609
{
11610+
struct cpu_rmap *rmap = NULL;
1161011611
int i, j, rc = 0;
1161111612
unsigned long flags = 0;
11612-
#ifdef CONFIG_RFS_ACCEL
11613-
struct cpu_rmap *rmap;
11614-
#endif
1161511613

1161611614
rc = bnxt_setup_int_mode(bp);
1161711615
if (rc) {
@@ -11632,15 +11630,15 @@ static int bnxt_request_irq(struct bnxt *bp)
1163211630
int map_idx = bnxt_cp_num_to_irq_num(bp, i);
1163311631
struct bnxt_irq *irq = &bp->irq_tbl[map_idx];
1163411632

11635-
#ifdef CONFIG_RFS_ACCEL
11636-
if (rmap && bp->bnapi[i]->rx_ring) {
11633+
if (IS_ENABLED(CONFIG_RFS_ACCEL) &&
11634+
rmap && bp->bnapi[i]->rx_ring) {
1163711635
rc = irq_cpu_rmap_add(rmap, irq->vector);
1163811636
if (rc)
1163911637
netdev_warn(bp->dev, "failed adding irq rmap for ring %d\n",
1164011638
j);
1164111639
j++;
1164211640
}
11643-
#endif
11641+
1164411642
rc = request_irq(irq->vector, irq->handler, flags, irq->name,
1164511643
bp->bnapi[i]);
1164611644
if (rc)

0 commit comments

Comments
 (0)