[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220520194320.2356236-2-kuba@kernel.org>
Date: Fri, 20 May 2022 12:43:13 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: kvalo@...nel.org, johannes@...solutions.net
Cc: netdev@...r.kernel.org, linux-wireless@...r.kernel.org,
Jakub Kicinski <kuba@...nel.org>, srini.raju@...elifi.com
Subject: [PATCH net-next 1/8] wifi: plfxlc: remove redundant NULL-check for GCC 12
GCC is upset that we check the return value of plfxlc_usb_dev()
even tho it can't be NULL:
drivers/net/wireless/purelifi/plfxlc/usb.c: In function ‘resume’:
drivers/net/wireless/purelifi/plfxlc/usb.c:840:20: warning: the comparison will always evaluate as ‘true’ for the address of ‘dev’ will never be NULL [-Waddress]
840 | if (!pl || !plfxlc_usb_dev(pl))
| ^
plfxlc_usb_dev() returns an address of one of the members of pl,
so it's safe to drop these checks.
Signed-off-by: Jakub Kicinski <kuba@...nel.org>
---
CC: srini.raju@...elifi.com
CC: kvalo@...nel.org
CC: linux-wireless@...r.kernel.org
---
drivers/net/wireless/purelifi/plfxlc/usb.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/purelifi/plfxlc/usb.c b/drivers/net/wireless/purelifi/plfxlc/usb.c
index d0e98b2f1365..8519cf0adfff 100644
--- a/drivers/net/wireless/purelifi/plfxlc/usb.c
+++ b/drivers/net/wireless/purelifi/plfxlc/usb.c
@@ -824,7 +824,7 @@ static int suspend(struct usb_interface *interface,
struct plfxlc_usb *pl = get_plfxlc_usb(interface);
struct plfxlc_mac *mac = plfxlc_usb_to_mac(pl);
- if (!pl || !plfxlc_usb_dev(pl))
+ if (!pl)
return -ENODEV;
if (pl->initialized == 0)
return 0;
@@ -837,7 +837,7 @@ static int resume(struct usb_interface *interface)
{
struct plfxlc_usb *pl = get_plfxlc_usb(interface);
- if (!pl || !plfxlc_usb_dev(pl))
+ if (!pl)
return -ENODEV;
if (pl->was_running)
plfxlc_usb_resume(pl);
--
2.34.3
Powered by blists - more mailing lists