]> git.baikalelectronics.ru Git - kernel.git/commit
igc: change default return of igc_read_phy_reg()
authorTom Rix <trix@redhat.com>
Fri, 21 May 2021 19:50:19 +0000 (12:50 -0700)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Thu, 1 Jul 2021 17:53:22 +0000 (10:53 -0700)
commit0d0b5218f18fbfb61d29dea164f44e3bd3b04991
treeaea5b09df1821b31546d2fe35e689c30489507fa
parente5d68133dbcf3748a7ecbf6a1116e96b08669400
igc: change default return of igc_read_phy_reg()

Static analysis reports this problem

igc_main.c:4944:20: warning: The left operand of '&'
  is a garbage value
    if (!(phy_data & SR_1000T_REMOTE_RX_STATUS) &&
          ~~~~~~~~ ^

phy_data is set by the call to igc_read_phy_reg() only if
there is a read_reg() op, else it is unset and a 0 is
returned.  Change the return to -EOPNOTSUPP.

Fixes: 611fafeb2e54 ("igc: Add watchdog")
Signed-off-by: Tom Rix <trix@redhat.com>
Tested-by: Dvora Fuxbrumer <dvorax.fuxbrumer@linux.intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/igc/igc.h