diff options
| author | Vladimir Oltean <[email protected]> | 2023-04-02 12:37:50 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2023-04-03 09:04:26 +0000 |
| commit | 1193db2a55b6b04f296f03affdfa80c16ecc3814 (patch) | |
| tree | 95db1d8a10f5e5cbd3406fc9e99f986cd3d96f60 | |
| parent | net: don't abuse "default" case for unknown ioctl in dev_ifsioc() (diff) | |
| download | kernel-1193db2a55b6b04f296f03affdfa80c16ecc3814.tar.gz kernel-1193db2a55b6b04f296f03affdfa80c16ecc3814.zip | |
net: simplify handling of dsa_ndo_eth_ioctl() return code
In the expression "x == 0 || x != -95", the term "x == 0" does not
change the expression's logical value, because 0 != -95, and so,
if x is 0, the expression would still be true by virtue of the second
term. If x is non-zero, the expression depends on the truth value of
the second term anyway. As such, the first term is redundant and can
be deleted.
Signed-off-by: Vladimir Oltean <[email protected]>
Reviewed-by: Florian Fainelli <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
| -rw-r--r-- | net/core/dev_ioctl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/dev_ioctl.c b/net/core/dev_ioctl.c index 1c0256ea522f..b299fb23fcfa 100644 --- a/net/core/dev_ioctl.c +++ b/net/core/dev_ioctl.c @@ -249,7 +249,7 @@ static int dev_eth_ioctl(struct net_device *dev, int err; err = dsa_ndo_eth_ioctl(dev, ifr, cmd); - if (err == 0 || err != -EOPNOTSUPP) + if (err != -EOPNOTSUPP) return err; if (ops->ndo_eth_ioctl) { |
