diff mbox series

[2/2] net: ax88796c: Remove pointless check in ax88796c_open()

Message ID 20211025211238.178768-2-nathan@kernel.org (mailing list archive)
State Accepted
Commit 971f5c4079ed46a131ad3ac6e684ed056a7777da
Delegated to: Netdev Maintainers
Headers show
Series [1/2] net: ax88796c: Fix clang -Wimplicit-fallthrough in ax88796c_set_mac() | expand

Checks

Context Check Description
netdev/cover_letter success Single patches do not need cover letters
netdev/fixes_present success Fixes tag not required for -next series
netdev/patch_count success Link
netdev/tree_selection success Guessed tree name to be net-next
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success No Fixes tag
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 15 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success No static functions without inline keyword in header files

Commit Message

Nathan Chancellor Oct. 25, 2021, 9:12 p.m. UTC
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>
---
 drivers/net/ethernet/asix/ax88796c_main.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/asix/ax88796c_main.c b/drivers/net/ethernet/asix/ax88796c_main.c
index cf0f96f93f3b..528a0c43540b 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,