lkml.org 
[lkml]   [2019]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subjectphy speed setting issue: e1000: Add support for the CE4100 reference platform
Date
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

\
 
 \ /
  Last update: 2019-02-16 15:27    [W:0.038 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site