Skip to content

Commit 971f5c4

Browse files
nathanchancedavem330
authored andcommitted
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: ClangBuiltLinux/linux#1492 Signed-off-by: Nathan Chancellor <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 3c55488 commit 971f5c4

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/net/ethernet/asix/ax88796c_main.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -850,11 +850,10 @@ ax88796c_open(struct net_device *ndev)
850850
/* Setup flow-control configuration */
851851
phy_support_asym_pause(ax_local->phydev);
852852

853-
if (ax_local->phydev->advertising &&
854-
(linkmode_test_bit(ETHTOOL_LINK_MODE_Pause_BIT,
855-
ax_local->phydev->advertising) ||
856-
linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT,
857-
ax_local->phydev->advertising)))
853+
if (linkmode_test_bit(ETHTOOL_LINK_MODE_Pause_BIT,
854+
ax_local->phydev->advertising) ||
855+
linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT,
856+
ax_local->phydev->advertising))
858857
fc |= AX_FC_ANEG;
859858

860859
fc |= linkmode_test_bit(ETHTOOL_LINK_MODE_Pause_BIT,

0 commit comments

Comments
 (0)