summaryrefslogtreecommitdiff
path: root/drivers/staging/ks7010
diff options
context:
space:
mode:
authorTobin C. Harding <me@tobin.cc>2017-04-10 13:15:51 +1000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-04-11 16:05:50 +0200
commit3da1b2371ec27accebe601e84a41f8b67f9b5688 (patch)
treed91c17978bd2e83079572f430d58dbd3bc6f3497 /drivers/staging/ks7010
parentb121d84882b97b8668be0b95e9ba50cfd01aa0f1 (diff)
staging: ks7010: utilize local variable
Function contains a local pointer variable defined to a memory location within a structure. This memory location is later used by dereferencing the struct instead of using the local pointer. The code is cleaner if all references of the same memory location use the local variable. Utilize existing local pointer variable instead of dereferencing struct. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/ks7010')
-rw-r--r--drivers/staging/ks7010/ks_wlan_net.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
index 9ee83a72714a..c36ce652c994 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -1788,9 +1788,9 @@ static int ks_wlan_set_encode_ext(struct net_device *dev,
key = &priv->wpa.key[index];
if (dwrq->flags & IW_ENCODE_DISABLED)
- priv->wpa.key[index].key_len = 0;
+ key->key_len = 0;
- priv->wpa.key[index].ext_flags = enc->ext_flags;
+ key->ext_flags = enc->ext_flags;
if (enc->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) {
priv->wpa.txkey = index;
commit |= SME_WEP_INDEX;
@@ -1806,7 +1806,7 @@ static int ks_wlan_set_encode_ext(struct net_device *dev,
priv->reg.privacy_invoked = 0x00;
commit |= SME_WEP_FLAG;
}
- priv->wpa.key[index].key_len = 0;
+ key->key_len = 0;
break;
case IW_ENCODE_ALG_WEP:
@@ -1842,7 +1842,7 @@ static int ks_wlan_set_encode_ext(struct net_device *dev,
default:
return -EINVAL;
}
- priv->wpa.key[index].alg = enc->alg;
+ key->alg = enc->alg;
if (commit) {
if (commit & SME_WEP_INDEX)