]> git.baikalelectronics.ru Git - kernel.git/commit
net: stmmac: drop redundant check in stmmac_mdio_reset
authorMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Sat, 15 Jun 2019 10:09:28 +0000 (12:09 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 16 Jun 2019 20:53:41 +0000 (13:53 -0700)
commit5606da6a1eca9a7943714474d914aecb941e5f3b
treee0e37d436f3e161b9b70bc0daaabc18ebccc3e73
parente75dc37f34d928d09f36111a7ef1f4b6b6fd79ac
net: stmmac: drop redundant check in stmmac_mdio_reset

A simplified version of the existing code looks like this:
  if (priv->device->of_node) {
      struct device_node *np = priv->device->of_node;
      if (!np)
          return 0;

The second "if" never evaluates to true because the first "if" checks
for exactly the opposite.
Drop the redundant check and early return to make the code easier to
understand.

No functional changes intended.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c