All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] net: dsa: sja1105: Add support for the SGMII port
@ 2020-04-07 13:51 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2020-04-07 13:51 UTC (permalink / raw)
  To: kernel-janitors

Hello Vladimir Oltean,

The patch ffe10e679cec: "net: dsa: sja1105: Add support for the SGMII
port" from Mar 20, 2020, leads to the following static checker
warning:

	drivers/net/dsa/sja1105/sja1105_main.c:1693 sja1105_static_config_reload()
	warn: bitwise AND condition is false here

drivers/net/dsa/sja1105/sja1105_main.c
  1680  
  1681          if (sja1105_supports_sgmii(priv, SJA1105_SGMII_PORT)) {
  1682                  bool an_enabled = !!(bmcr & BMCR_ANENABLE);
  1683  
  1684                  sja1105_sgmii_pcs_config(priv, an_enabled, false);
  1685  
  1686                  if (!an_enabled) {
  1687                          int speed = SPEED_UNKNOWN;
  1688  
  1689                          if (bmcr & BMCR_SPEED1000)
  1690                                  speed = SPEED_1000;
  1691                          else if (bmcr & BMCR_SPEED100)
  1692                                  speed = SPEED_100;
  1693                          else if (bmcr & BMCR_SPEED10)
                                                ^^^^^^^^^^^^
This is zero so the condition can never be true.

  1694                                  speed = SPEED_10;
  1695  
  1696                          sja1105_sgmii_pcs_force_speed(priv, speed);
  1697                  }
  1698          }
  1699  out:
  1700          mutex_unlock(&priv->mgmt_lock);
  1701  
  1702          return rc;

regards,
dan carpenter

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

only message in thread, other threads:[~2020-04-07 13:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-07 13:51 [bug report] net: dsa: sja1105: Add support for the SGMII port Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.