From: Nathan Chancellor <nathan@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Phillip Potter <phil@philpotter.co.uk>,
Larry Finger <Larry.Finger@lwfinger.net>
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
clang-built-linux@googlegroups.com,
Nathan Chancellor <nathan@kernel.org>
Subject: [PATCH 4/4] staging: r8188eu: Remove pointless NULL check in rtw_check_join_candidate()
Date: Tue, 3 Aug 2021 15:36:09 -0700 [thread overview]
Message-ID: <20210803223609.1627280-5-nathan@kernel.org> (raw)
In-Reply-To: <20210803223609.1627280-1-nathan@kernel.org>
Clang warns:
drivers/staging/r8188eu/core/rtw_mlme.c:1629:28: warning: address of
array 'pmlmepriv->assoc_ssid.Ssid' will always evaluate to 'true'
[-Wpointer-bool-conversion]
if (pmlmepriv->assoc_ssid.Ssid && pmlmepriv->assoc_ssid.SsidLength) {
~~~~~~~~~~~~~~~~~~~~~~^~~~ ~~
1 warning generated.
Ssid is an array not at the beginning of a struct so its address cannot
be NULL so remove the check.
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
drivers/staging/r8188eu/core/rtw_mlme.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/r8188eu/core/rtw_mlme.c b/drivers/staging/r8188eu/core/rtw_mlme.c
index fa4df4a3a2df..16d8f7317897 100644
--- a/drivers/staging/r8188eu/core/rtw_mlme.c
+++ b/drivers/staging/r8188eu/core/rtw_mlme.c
@@ -1626,7 +1626,7 @@ static int rtw_check_join_candidate(struct mlme_priv *pmlmepriv
}
/* check ssid, if needed */
- if (pmlmepriv->assoc_ssid.Ssid && pmlmepriv->assoc_ssid.SsidLength) {
+ if (pmlmepriv->assoc_ssid.SsidLength) {
if (competitor->network.Ssid.SsidLength != pmlmepriv->assoc_ssid.SsidLength ||
memcmp(competitor->network.Ssid.Ssid, pmlmepriv->assoc_ssid.Ssid, pmlmepriv->assoc_ssid.SsidLength))
goto exit;
--
2.33.0.rc0
next prev parent reply other threads:[~2021-08-03 22:36 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-03 22:36 [PATCH 0/4] staging: r8188eu: Fix clang warnings Nathan Chancellor
2021-08-03 22:36 ` [PATCH 1/4] staging: r8188eu: Remove _rtw_spinlock_free() Nathan Chancellor
2021-08-03 22:36 ` [PATCH 2/4] staging: r8188eu: Remove unnecessary parentheses Nathan Chancellor
2021-08-04 17:46 ` Nick Desaulniers
2021-08-04 18:46 ` Nathan Chancellor
2021-08-03 22:36 ` [PATCH 3/4] staging: r8188eu: Remove self assignment in get_rx_power_val_by_reg() Nathan Chancellor
2021-08-04 18:37 ` Nick Desaulniers
2021-08-04 18:49 ` Nathan Chancellor
2021-08-03 22:36 ` Nathan Chancellor [this message]
2021-08-05 11:11 ` [PATCH 0/4] staging: r8188eu: Fix clang warnings Greg Kroah-Hartman
2021-08-05 18:58 ` [PATCH v2 0/3] " Nathan Chancellor
2021-08-05 18:58 ` [PATCH v2 1/3] staging: r8188eu: Remove unnecessary parentheses Nathan Chancellor
2021-08-05 18:58 ` [PATCH v2 2/3] staging: r8188eu: Remove self assignment in get_rx_power_val_by_reg() Nathan Chancellor
2021-08-05 18:58 ` [PATCH v2 3/3] staging: r8188eu: Remove pointless NULL check in rtw_check_join_candidate() Nathan Chancellor
2021-08-05 19:51 ` Nick Desaulniers
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=20210803223609.1627280-5-nathan@kernel.org \
--to=nathan@kernel.org \
--cc=Larry.Finger@lwfinger.net \
--cc=clang-built-linux@googlegroups.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=phil@philpotter.co.uk \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.