]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
staging: ks7010: avoid casts in michael_mic_function calls
authorSergio Paracuellos <sergio.paracuellos@gmail.com>
Mon, 23 Apr 2018 13:44:34 +0000 (15:44 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Apr 2018 13:47:22 +0000 (15:47 +0200)
This commit removes casts in calls to michael_mic_function.
Most of them are nosense because types match perfectly function
parameters. To avoid also int casting for len parameter just
pass unsigned len to function which makes sense because is only
being called with unsigned int len parameters.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ks7010/ks_hostif.c
drivers/staging/ks7010/michael_mic.c
drivers/staging/ks7010/michael_mic.h

index e5657dc3fd5119fadba13db4daffa93cf01c2e4d..d11b0a2259e239a336a842657f7c615eb680510f 100644 (file)
@@ -337,12 +337,9 @@ 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 */
-                       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);
+                       michael_mic_function(&michael_mic, key->rx_mic_key,
+                                            priv->rxp, priv->rx_size,
+                                            0, michael_mic.result);
                }
                if (memcmp(michael_mic.result, recv_mic, 8) != 0) {
                        now = jiffies;
@@ -1164,11 +1161,9 @@ int hostif_data_request(struct ks_wlan_private *priv, struct sk_buff *skb)
                } else {
                        if (priv->wpa.pairwise_suite == IW_AUTH_CIPHER_TKIP) {
                                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);
+                                                    priv->wpa.key[0].tx_mic_key,
+                                                    &pp->data[0], skb_len,
+                                                    0, michael_mic.result);
                                memcpy(p, michael_mic.result, 8);
                                length += 8;
                                skb_len += 8;
index 6bc1b093be80051773e8c27969e19f0f9fda2f29..2128c84414050e180c113b7642a9d8a4e0732033 100644 (file)
@@ -110,7 +110,7 @@ static void michael_get_mic(struct michael_mic *mic, u8 *dst)
 }
 
 void michael_mic_function(struct michael_mic *mic, u8 *key,
-                         u8 *data, int len, u8 priority, u8 *result)
+                         u8 *data, unsigned int len, u8 priority, u8 *result)
 {
        u8 pad_data[4] = { priority, 0, 0, 0 };
        // Compute the MIC value
index d33508070088a6f8fa8d1567ff7dd681f389de48..eb22fdd660d9f130d5cad4b592737b7d08ee55e2 100644 (file)
@@ -21,4 +21,4 @@ struct michael_mic {
 };
 
 void michael_mic_function(struct michael_mic *mic, u8 *key,
-                         u8 *data, int len, u8 priority, u8 *result);
+                         u8 *data, unsigned int len, u8 priority, u8 *result);