[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181219030013.13736-1-yuehaibing@huawei.com>
Date: Wed, 19 Dec 2018 11:00:13 +0800
From: YueHaibing <yuehaibing@...wei.com>
To: <davem@...emloft.net>, <stas.yakovlev@...il.com>,
<kvalo@...eaurora.org>
CC: <linux-kernel@...r.kernel.org>, <netdev@...r.kernel.org>,
<linux-wireless@...r.kernel.org>,
YueHaibing <yuehaibing@...wei.com>
Subject: [PATCH] ipw2x00: cleanup dead code
Fix smatch warning:
drivers/net/wireless/intel/ipw2x00/ipw2100.c:5606
shim__set_security() warn: always true condition '(sec->active_key <= 3) => (0-3 <= 3)'
drivers/net/wireless/intel/ipw2x00/ipw2200.c:10725
shim__set_security() warn: always true condition '(sec->active_key <= 3) => (0-3 <= 3)'
Signed-off-by: YueHaibing <yuehaibing@...wei.com>
---
drivers/net/wireless/intel/ipw2x00/ipw2100.c | 8 ++------
drivers/net/wireless/intel/ipw2x00/ipw2200.c | 7 ++-----
2 files changed, 4 insertions(+), 11 deletions(-)
diff --git a/drivers/net/wireless/intel/ipw2x00/ipw2100.c b/drivers/net/wireless/intel/ipw2x00/ipw2100.c
index 6e31687..52e5ed2 100644
--- a/drivers/net/wireless/intel/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/intel/ipw2x00/ipw2100.c
@@ -5603,12 +5603,8 @@ static void shim__set_security(struct net_device *dev,
if ((sec->flags & SEC_ACTIVE_KEY) &&
priv->ieee->sec.active_key != sec->active_key) {
- if (sec->active_key <= 3) {
- priv->ieee->sec.active_key = sec->active_key;
- priv->ieee->sec.flags |= SEC_ACTIVE_KEY;
- } else
- priv->ieee->sec.flags &= ~SEC_ACTIVE_KEY;
-
+ priv->ieee->sec.active_key = sec->active_key;
+ priv->ieee->sec.flags |= SEC_ACTIVE_KEY;
priv->status |= STATUS_SECURITY_UPDATED;
}
diff --git a/drivers/net/wireless/intel/ipw2x00/ipw2200.c b/drivers/net/wireless/intel/ipw2x00/ipw2200.c
index bbdca13..fa400f9 100644
--- a/drivers/net/wireless/intel/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/intel/ipw2x00/ipw2200.c
@@ -10722,11 +10722,8 @@ static void shim__set_security(struct net_device *dev,
}
if (sec->flags & SEC_ACTIVE_KEY) {
- if (sec->active_key <= 3) {
- priv->ieee->sec.active_key = sec->active_key;
- priv->ieee->sec.flags |= SEC_ACTIVE_KEY;
- } else
- priv->ieee->sec.flags &= ~SEC_ACTIVE_KEY;
+ priv->ieee->sec.active_key = sec->active_key;
+ priv->ieee->sec.flags |= SEC_ACTIVE_KEY;
priv->status |= STATUS_SECURITY_UPDATED;
} else
priv->ieee->sec.flags &= ~SEC_ACTIVE_KEY;
--
2.7.0
Powered by blists - more mailing lists