From: Nathan Chancellor <natechancellor@gmail.com>
To: devel@driverdev.osuosl.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
Ganesh Krishna <ganesh.krishna@microchip.com>,
Aditya Shankar <aditya.shankar@microchip.com>,
Nathan Chancellor <natechancellor@gmail.com>
Subject: [PATCH 3/3] staging: wilc1000: Remove unnecessary array index check
Date: Sun, 6 May 2018 00:33:33 -0700 [thread overview]
Message-ID: <20180506073333.3770-3-natechancellor@gmail.com> (raw)
In-Reply-To: <20180506073333.3770-1-natechancellor@gmail.com>
This statment triggers GCC's -Wtype-limit since key_index is an
unsigned integer so it cannot be less than zero.
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
---
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index b499fb987395..e0015ca6c21a 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -1054,7 +1054,7 @@ static int del_key(struct wiphy *wiphy, struct net_device *netdev,
}
}
- if (key_index >= 0 && key_index <= 3 && priv->wep_key_len[key_index]) {
+ if (key_index <= 3 && priv->wep_key_len[key_index]) {
memset(priv->wep_key[key_index], 0,
priv->wep_key_len[key_index]);
priv->wep_key_len[key_index] = 0;
--
2.17.0
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
next prev parent reply other threads:[~2018-05-06 7:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-06 7:33 [PATCH 1/3] staging: wilc1000: Remove unused variables Nathan Chancellor
2018-05-06 7:33 ` [PATCH 2/3] staging: wilc1000: Remove useless function Nathan Chancellor
2018-05-07 5:54 ` Ajay Singh
2018-05-06 7:33 ` Nathan Chancellor [this message]
2018-05-07 5:55 ` [PATCH 3/3] staging: wilc1000: Remove unnecessary array index check Ajay Singh
2018-05-07 5:53 ` [PATCH 1/3] staging: wilc1000: Remove unused variables Ajay Singh
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=20180506073333.3770-3-natechancellor@gmail.com \
--to=natechancellor@gmail.com \
--cc=aditya.shankar@microchip.com \
--cc=devel@driverdev.osuosl.org \
--cc=ganesh.krishna@microchip.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@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;
as well as URLs for NNTP newsgroup(s).