[PATCH 02/12] staging: ks7010: avoid camel cases in MichaelMICFunction

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

 



This commit replace camel cases for name and params used in
MichaelMICFunction. This improves a bit readability.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@xxxxxxxxx>
---
 drivers/staging/ks7010/ks_hostif.c   | 24 ++++++++++++------------
 drivers/staging/ks7010/michael_mic.c | 15 +++++++--------
 drivers/staging/ks7010/michael_mic.h |  5 ++---
 3 files changed, 21 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
index 07795f6..fe20aca 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -344,12 +344,12 @@ int hostif_data_indication_wpa(struct ks_wlan_private *priv,
 		memcpy(&recv_mic[0], (priv->rxp) + ((priv->rx_size) - 8), 8);
 		priv->rx_size = priv->rx_size - 8;
 		if (auth_type > 0 && auth_type < 4) {	/* auth_type check */
-			MichaelMICFunction(&michael_mic,
-					   (uint8_t *)key->rx_mic_key,
-					   (uint8_t *)priv->rxp,
-					   (int)priv->rx_size,
-					   (uint8_t)0,	/* priority */
-					   (uint8_t *)michael_mic.result);
+			michael_mic_function(&michael_mic,
+					     (uint8_t *)key->rx_mic_key,
+					     (uint8_t *)priv->rxp,
+					     (int)priv->rx_size,
+					     (uint8_t)0,	/* priority */
+					     (uint8_t *)michael_mic.result);
 		}
 		if (memcmp(michael_mic.result, recv_mic, 8) != 0) {
 			now = jiffies;
@@ -1169,12 +1169,12 @@ int hostif_data_request(struct ks_wlan_private *priv, struct sk_buff *skb)
 			pp->auth_type = cpu_to_le16((uint16_t)TYPE_AUTH);	/* no encryption */
 		} else {
 			if (priv->wpa.pairwise_suite == IW_AUTH_CIPHER_TKIP) {
-				MichaelMICFunction(&michael_mic,
-						   (uint8_t *)priv->wpa.key[0].tx_mic_key,
-						   (uint8_t *)&pp->data[0],
-						   (int)skb_len,
-						   (uint8_t)0,	/* priority */
-						   (uint8_t *)michael_mic.result);
+				michael_mic_function(&michael_mic,
+						     (uint8_t *)priv->wpa.key[0].tx_mic_key,
+						     (uint8_t *)&pp->data[0],
+						     (int)skb_len,
+						     (uint8_t)0,	/* priority */
+						     (uint8_t *)michael_mic.result);
 				memcpy(p, michael_mic.result, 8);
 				length += 8;
 				skb_len += 8;
diff --git a/drivers/staging/ks7010/michael_mic.c b/drivers/staging/ks7010/michael_mic.c
index 861721d..f795043 100644
--- a/drivers/staging/ks7010/michael_mic.c
+++ b/drivers/staging/ks7010/michael_mic.c
@@ -123,9 +123,8 @@ void MichaelGetMIC(struct michael_mic_t *Mic, uint8_t *dst)
 	MichaelClear(Mic);
 }
 
-void MichaelMICFunction(struct michael_mic_t *Mic, u8 *Key,
-			u8 *Data, int Len, u8 priority,
-			u8 *Result)
+void michael_mic_function(struct michael_mic_t *mic, u8 *key,
+			  u8 *data, int len, u8 priority, u8 *result)
 {
 	u8 pad_data[4] = { priority, 0, 0, 0 };
 	// Compute the MIC value
@@ -138,9 +137,9 @@ void MichaelMICFunction(struct michael_mic_t *Mic, u8 *Key,
 	 * |DA|SA|Priority|0 |Data|M0|M1|M2|M3|M4|M5|M6|M7|
 	 * +--+--+--------+--+----+--+--+--+--+--+--+--+--+
 	 */
-	MichaelInitializeFunction(Mic, Key);
-	MichaelAppend(Mic, (uint8_t *)Data, 12);	/* |DA|SA| */
-	MichaelAppend(Mic, pad_data, 4);	/* |Priority|0|0|0| */
-	MichaelAppend(Mic, (uint8_t *)(Data + 12), Len - 12);	/* |Data| */
-	MichaelGetMIC(Mic, Result);
+	MichaelInitializeFunction(mic, key);
+	MichaelAppend(mic, (uint8_t *)data, 12);	/* |DA|SA| */
+	MichaelAppend(mic, pad_data, 4);	/* |Priority|0|0|0| */
+	MichaelAppend(mic, (uint8_t *)(data + 12), len - 12);	/* |Data| */
+	MichaelGetMIC(mic, result);
 }
diff --git a/drivers/staging/ks7010/michael_mic.h b/drivers/staging/ks7010/michael_mic.h
index 64db7d1..894a8d4 100644
--- a/drivers/staging/ks7010/michael_mic.h
+++ b/drivers/staging/ks7010/michael_mic.h
@@ -20,6 +20,5 @@ struct michael_mic_t {
 	u8 result[8];
 };
 
-void MichaelMICFunction(struct michael_mic_t *Mic, u8 *Key,
-			u8 *Data, int Len, u8 priority,
-			u8 *Result);
+void michael_mic_function(struct michael_mic_t *mic, u8 *key,
+			  u8 *data, int len, u8 priority, u8 *result);
-- 
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