[PATCH 3/5] staging: ks7010: fix parameter placement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Checkpatch emits multiple WARNING: Avoid multiple line
dereference. Patch to fix these warnings also illuminates another
function call with smelly code layout, we should fix this too so as to
ease review.

Move dereference to single line, do this 4 times, each fixing a
checkpatch warning. Remove unnecessary newline in preceding code.

Signed-off-by: Tobin C. Harding <me@xxxxxxxx>
---
 drivers/staging/ks7010/ks_wlan_net.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
index b467307..8315915 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -1830,18 +1830,17 @@ static int ks_wlan_set_encode_ext(struct net_device *dev,
 		if (enc->key_len == 32) {
 			memcpy(&priv->wpa.key[index].key_val[0],
 			       &enc->key[0], enc->key_len - 16);
-			priv->wpa.key[index].key_len =
-				enc->key_len - 16;
+			priv->wpa.key[index].key_len = enc->key_len - 16;
 			if (priv->wpa.key_mgmt_suite == 4) {	/* WPA_NONE */
-				memcpy(&priv->wpa.key[index].
-				       tx_mic_key[0], &enc->key[16], 8);
-				memcpy(&priv->wpa.key[index].
-				       rx_mic_key[0], &enc->key[16], 8);
+				memcpy(&priv->wpa.key[index].tx_mic_key[0],
+				       &enc->key[16], 8);
+				memcpy(&priv->wpa.key[index].rx_mic_key[0],
+				       &enc->key[16], 8);
 			} else {
-				memcpy(&priv->wpa.key[index].
-				       tx_mic_key[0], &enc->key[16], 8);
-				memcpy(&priv->wpa.key[index].
-				       rx_mic_key[0], &enc->key[24], 8);
+				memcpy(&priv->wpa.key[index].tx_mic_key[0],
+				       &enc->key[16], 8);
+				memcpy(&priv->wpa.key[index].rx_mic_key[0],
+				       &enc->key[24], 8);
 			}
 			commit |= (SME_WEP_VAL1 << index);
 		}
-- 
2.7.4

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux