mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-14 14:42:34 -04:00
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 <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
e396de684e
commit
5e5cd8089a
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user