netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] bnxt_en: eliminate the compile warning in bnxt_request_irq due to CONFIG_RFS_ACCEL
@ 2025-06-29  0:36 Jason Xing
  2025-06-30 11:09 ` Simon Horman
  2025-07-01  4:07 ` Michael Chan
  0 siblings, 2 replies; 10+ messages in thread
From: Jason Xing @ 2025-06-29  0:36 UTC (permalink / raw)
  To: davem, edumazet, kuba, pabeni, andrew+netdev, michael.chan,
	pavan.chebbi
  Cc: netdev, Jason Xing, kernel test robot

From: Jason Xing <kernelxing@tencent.com>

I received a kernel-test-bot report[1] that shows the
[-Wunused-but-set-variable] warning. Since the previous commit[2] I made
gives users an option to turn on and off the CONFIG_RFS_ACCEL, the issue
then can be discovered and reproduced. Move the @i into the protection
of CONFIG_RFS_ACCEL.

[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;
         |         ^

[2]
commit 9b6a30febddf ("net: allow rps/rfs related configs to be switched")

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202506282102.x1tXt0qz-lkp@intel.com/
Signed-off-by: Jason Xing <kernelxing@tencent.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 869580b6f70d..7369b39380d0 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -11538,9 +11538,10 @@ static void bnxt_free_irq(struct bnxt *bp)
 
 static int bnxt_request_irq(struct bnxt *bp)
 {
-	int i, j, rc = 0;
+	int i, rc = 0;
 	unsigned long flags = 0;
 #ifdef CONFIG_RFS_ACCEL
+	int j = 0;
 	struct cpu_rmap *rmap;
 #endif
 
@@ -11559,7 +11560,7 @@ static int bnxt_request_irq(struct bnxt *bp)
 	if (!rc)
 		bp->tph_mode = PCI_TPH_ST_IV_MODE;
 
-	for (i = 0, j = 0; i < bp->cp_nr_rings; i++) {
+	for (i = 0; i < bp->cp_nr_rings; i++) {
 		int map_idx = bnxt_cp_num_to_irq_num(bp, i);
 		struct bnxt_irq *irq = &bp->irq_tbl[map_idx];
 
-- 
2.41.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-07-02  1:34 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-29  0:36 [PATCH net] bnxt_en: eliminate the compile warning in bnxt_request_irq due to CONFIG_RFS_ACCEL Jason Xing
2025-06-30 11:09 ` Simon Horman
2025-06-30 11:47   ` Jason Xing
2025-07-02  0:15     ` Jakub Kicinski
2025-07-02  0:47       ` Jason Xing
2025-07-02  0:56         ` Jakub Kicinski
2025-07-02  1:07           ` Jason Xing
2025-07-02  1:11             ` Jason Xing
2025-07-02  1:34               ` Jakub Kicinski
2025-07-01  4:07 ` Michael Chan

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).