diff options
author | Nathan Chancellor <nathan@kernel.org> | 2021-10-25 14:12:39 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-10-26 14:57:23 +0100 |
commit | 971f5c4079ed46a131ad3ac6e684ed056a7777da (patch) | |
tree | 688cb6512d893f81f1c0e9f8f8ce6e6c9114ff0b | |
parent | 3c5548812a0cf536b98f8d9f7f9377bd304809c1 (diff) |
net: ax88796c: Remove pointless check in ax88796c_open()
Clang warns:
drivers/net/ethernet/asix/ax88796c_main.c:851:24: error: address of
array 'ax_local->phydev->advertising' will always evaluate to 'true'
[-Werror,-Wpointer-bool-conversion]
if (ax_local->phydev->advertising &&
~~~~~~~~~~~~~~~~~~^~~~~~~~~~~ ~~
advertising cannot be NULL here if ax_local is not NULL, which cannot
happen due to the check in ax88796c_probe(). Remove the check.
Link: https://github.com/ClangBuiltLinux/linux/issues/1492
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/asix/ax88796c_main.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/net/ethernet/asix/ax88796c_main.c b/drivers/net/ethernet/asix/ax88796c_main.c index 3f25fafd422e..4b0c5a09fd57 100644 --- a/drivers/net/ethernet/asix/ax88796c_main.c +++ b/drivers/net/ethernet/asix/ax88796c_main.c @@ -850,11 +850,10 @@ ax88796c_open(struct net_device *ndev) /* Setup flow-control configuration */ phy_support_asym_pause(ax_local->phydev); - if (ax_local->phydev->advertising && - (linkmode_test_bit(ETHTOOL_LINK_MODE_Pause_BIT, - ax_local->phydev->advertising) || - linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, - ax_local->phydev->advertising))) + if (linkmode_test_bit(ETHTOOL_LINK_MODE_Pause_BIT, + ax_local->phydev->advertising) || + linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, + ax_local->phydev->advertising)) fc |= AX_FC_ANEG; fc |= linkmode_test_bit(ETHTOOL_LINK_MODE_Pause_BIT, |