From: Sergio Paracuellos Date: Mon, 23 Apr 2018 13:44:34 +0000 (+0200) Subject: staging: ks7010: avoid casts in michael_mic_function calls X-Git-Tag: Ubuntu-5.13.0-19.19~10836^2~546 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=5e5cd8089ae91183679213d8273a7682edbc2e06;p=mirror_ubuntu-jammy-kernel.git staging: ks7010: avoid casts in michael_mic_function calls 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c index e5657dc3fd51..d11b0a2259e2 100644 --- a/drivers/staging/ks7010/ks_hostif.c +++ b/drivers/staging/ks7010/ks_hostif.c @@ -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; diff --git a/drivers/staging/ks7010/michael_mic.c b/drivers/staging/ks7010/michael_mic.c index 6bc1b093be80..2128c8441405 100644 --- a/drivers/staging/ks7010/michael_mic.c +++ b/drivers/staging/ks7010/michael_mic.c @@ -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 diff --git a/drivers/staging/ks7010/michael_mic.h b/drivers/staging/ks7010/michael_mic.h index d33508070088..eb22fdd660d9 100644 --- a/drivers/staging/ks7010/michael_mic.h +++ b/drivers/staging/ks7010/michael_mic.h @@ -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);