From d96f3a7cecdc399af19da3268f69d2d05b07093d Mon Sep 17 00:00:00 2001 From: Sergio Paracuellos Date: Fri, 4 May 2018 06:16:29 +0200 Subject: [PATCH] staging: ks7010: change type for rsn_enabled in wpa_status struct Field rsn_enabled included in wpa_status struct is declared as unsigned int but it is only be set using 0 and 1 values and in conditional if code is just being used as a boolean. Change its type to be a boolean. Signed-off-by: Sergio Paracuellos Signed-off-by: Greg Kroah-Hartman --- drivers/staging/ks7010/ks_hostif.c | 2 +- drivers/staging/ks7010/ks_wlan.h | 2 +- drivers/staging/ks7010/ks_wlan_net.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c index 0ab2e1b08329..8cd3dac4fcd3 100644 --- a/drivers/staging/ks7010/ks_hostif.c +++ b/drivers/staging/ks7010/ks_hostif.c @@ -2296,7 +2296,7 @@ static inline void hostif_sme_init(struct ks_wlan_private *priv) static inline void hostif_wpa_init(struct ks_wlan_private *priv) { memset(&priv->wpa, 0, sizeof(priv->wpa)); - priv->wpa.rsn_enabled = 0; + priv->wpa.rsn_enabled = false; priv->wpa.mic_failure.failure = 0; priv->wpa.mic_failure.last_failure_time = 0; priv->wpa.mic_failure.stop = 0; diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/staging/ks7010/ks_wlan.h index dd42692de451..655f1e3a2157 100644 --- a/drivers/staging/ks7010/ks_wlan.h +++ b/drivers/staging/ks7010/ks_wlan.h @@ -338,7 +338,7 @@ struct mic_failure { struct wpa_status { int wpa_enabled; - unsigned int rsn_enabled; + bool rsn_enabled; int version; int pairwise_suite; /* unicast cipher */ int group_suite; /* multicast cipher */ diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c index 838db49898d4..8b4a1ed636bd 100644 --- a/drivers/staging/ks7010/ks_wlan_net.c +++ b/drivers/staging/ks7010/ks_wlan_net.c @@ -1372,14 +1372,14 @@ static int ks_wlan_set_auth_mode(struct net_device *dev, case IW_AUTH_WPA_VERSION_DISABLED: priv->wpa.version = value; if (priv->wpa.rsn_enabled) - priv->wpa.rsn_enabled = 0; + priv->wpa.rsn_enabled = false; priv->need_commit |= SME_RSN; break; case IW_AUTH_WPA_VERSION_WPA: case IW_AUTH_WPA_VERSION_WPA2: priv->wpa.version = value; if (!(priv->wpa.rsn_enabled)) - priv->wpa.rsn_enabled = 1; + priv->wpa.rsn_enabled = true; priv->need_commit |= SME_RSN; break; default: -- 2.30.2