[v1,08/24] net/igc/base: fix unused value

Message ID 107cc06be82c038a1d340d4b4ebfe52d2674e607.1738858026.git.anatoly.burakov@intel.com (mailing list archive)
State Accepted
Delegated to: Bruce Richardson
Headers
Series Fixes for igc and e1000 |

Checks

Context Check Description
ci/checkpatch warning coding style issues

Commit Message

Burakov, Anatoly Feb. 6, 2025, 4:08 p.m. UTC
From: Dima Ruinskiy <dima.ruinskiy@intel.com>

Static analysis has reported that when there is no get link status callback
function, the value set in the if condition is not used and gets
overwritten in the "out" section of the code. Fix by not seting the
variable.

Fixes: 8cb7c57d9b3c ("net/igc: support device initialization")
Cc: stable@dpdk.org

Signed-off-by: Dima Ruinskiy <dima.ruinskiy@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/net/intel/igc/base/igc_i225.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
  

Patch

diff --git a/drivers/net/intel/igc/base/igc_i225.c b/drivers/net/intel/igc/base/igc_i225.c
index c7c2ec8ffe..23c68a3948 100644
--- a/drivers/net/intel/igc/base/igc_i225.c
+++ b/drivers/net/intel/igc/base/igc_i225.c
@@ -1114,10 +1114,8 @@  s32 igc_check_for_link_i225(struct igc_hw *hw)
 	 * changed.  The get_link_status flag is set upon receiving
 	 * a Link Status Change or Rx Sequence Error interrupt.
 	 */
-	if (!mac->get_link_status) {
-		ret_val = IGC_SUCCESS;
+	if (!mac->get_link_status)
 		goto out;
-	}
 
 	/* First we want to see if the MII Status Register reports
 	 * link.  If so, then we want to get the current speed/duplex