netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* phy speed setting issue: e1000: Add support for the CE4100 reference platform
@ 2019-02-16 14:26 Colin Ian King
  0 siblings, 0 replies; only message in thread
From: Colin Ian King @ 2019-02-16 14:26 UTC (permalink / raw)
  To: Dirk Brandewie, Jeff Pieper, Jeff Kirsher
  Cc: David S. Miller, netdev, linux-kernel

Hi,

Static analysis from CoverityScan has detected an issue with the speed
setup with the control setting in the e1000 driver.

Function e1000_config_mac_to_phy in
/drivers/net/ethernet/intel/e1000/e1000_hw.c, CoverityScan reports:

CID 140032 (#1 of 1): Operands don't affect result
(CONSTANT_EXPRESSION_RESULT)

result_independent_of_operands: phy_data & 0x200000 is always 0
regardless of the values of its operands. This occurs as the logical
operand of if.

1936                if (phy_data & RTL_PHY_CTRL_SPD_100)
1937                        ctrl |= E1000_CTRL_SPD_100;
1938                else
1939                        ctrl |= E1000_CTRL_SPD_10;


phy_data is a u16 however the 100 mbit speed bitmask is 0x200000, hence
the bitwise with phy_data will always result in zero, and so the ctrl is
never set to E1000_CTRL_SPD_100.

I'm not familiar with this hardware, so I'm not sure what appropriate
mask should be.

Issue was introduced with commit: 5377a4160bb6 ("e1000: Add support for
the CE4100 reference platform")

Colin

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-02-16 14:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-16 14:26 phy speed setting issue: e1000: Add support for the CE4100 reference platform Colin Ian King

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