[bug report] bnxt_en: Handle firmware reset.

From: Dan Carpenter <hidden>
Date: 2026-08-19 07:06:53

[ This old code shows up as a new warning because it was reverted and
  then re-applied. ]

Hello Michael Chan,

Commit 230d1f0de754 ("bnxt_en: Handle firmware reset.") from Aug 29,
2019 (linux-next), leads to the following Smatch static checker
warning:

	drivers/net/ethernet/broadcom/bnxt/bnxt.c:15484 bnxt_fw_reset_task()
	warn: replace while loop with if statement?

drivers/net/ethernet/broadcom/bnxt/bnxt.c
    15481                 bp->fw_reset_state = BNXT_FW_RESET_STATE_OPENING;
    15482                 fallthrough;
    15483         case BNXT_FW_RESET_STATE_OPENING:
--> 15484                 while (!rtnl_trylock()) {

This while () would be more readabel as an if ().

    15485                         bnxt_queue_fw_reset_work(bp, HZ / 10);
    15486                         return;
                                  ^^^^^^^
Since it doesn't loop.

    15487                 }
    15488                 netdev_lock(bp->dev);
    15489                 rc = bnxt_open(bp->dev);
    15490                 if (rc) {
    15491                         netdev_err(bp->dev, "bnxt_open() failed during FW reset\n");

This email is a free service from the Smatch-CI project [smatch.sf.net].

regards,
dan carpenter
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help