netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* re: e1000: Add support for the CE4100 reference platform
@ 2020-05-01 17:03 Colin Ian King
  0 siblings, 0 replies; only message in thread
From: Colin Ian King @ 2020-05-01 17:03 UTC (permalink / raw)
  To: David S. Miller, netdev, Dirk Brandewie, Jeff Pieper, Jeff Kirsher
  Cc: linux-kernel

Hi,

Static analysis with Coverity has detected an issue with setting the
speed control on the e1000 driver. This was introduced back in 2011 with
the following commit:

commit 5377a4160bb65ee4dd11b4b1d081d86d56d92bff
Author: Dirk Brandewie <dirk.j.brandewie@intel.com>
Date:   Thu Jan 6 14:29:54 2011 +0000

    e1000: Add support for the CE4100 reference platform

The Coverity analysis is as follows for function
e1000_config_mac_to_phy() in source
drivers/net/ethernet/intel/e1000/e1000_hw.c:

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 and it is being and-ed with 0x200000 and this always
is zero, so the E1000_CTRL_SPD_100 is never set.

Colin

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

only message in thread, other threads:[~2020-05-01 17:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-01 17:03 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).