From: Arnd Bergmann <arnd@kernel.org>
To: "Łukasz Stelmach" <l.stelmach@samsung.com>,
"David S. Miller" <davem@davemloft.net>,
"Jakub Kicinski" <kuba@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
llvm@lists.linux.dev
Subject: [PATCH net-next] net: ax88796c: fix -Wpointer-bool-conversion warning
Date: Tue, 26 Oct 2021 21:56:39 +0200 [thread overview]
Message-ID: <20211026195711.16152-1-arnd@kernel.org> (raw)
From: Arnd Bergmann <arnd@arndb.de>
ax_local->phydev->advertising is an array, not a pointer, so
clang points out that checking for NULL is unnecessary:
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 &&
~~~~~~~~~~~~~~~~~~^~~~~~~~~~~ ~~
Fixes: a97c69ba4f30 ("net: ax88796c: ASIX AX88796C SPI Ethernet Adapter Driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/net/ethernet/asix/ax88796c_main.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/asix/ax88796c_main.c b/drivers/net/ethernet/asix/ax88796c_main.c
index cfc597f72e3d..846a04922561 100644
--- a/drivers/net/ethernet/asix/ax88796c_main.c
+++ b/drivers/net/ethernet/asix/ax88796c_main.c
@@ -848,11 +848,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,
--
2.29.2
next reply other threads:[~2021-10-26 19:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-26 19:56 Arnd Bergmann [this message]
2021-10-26 19:59 ` [PATCH net-next] net: ax88796c: fix -Wpointer-bool-conversion warning Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211026195711.16152-1-arnd@kernel.org \
--to=arnd@kernel.org \
--cc=arnd@arndb.de \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=l.stelmach@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox