mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: suniel.spartan@gmail.com
To: gregkh@linuxfoundation.org
Cc: linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org,
	sunil.m@techveda.org, Suniel Mahesh <suniel.spartan@gmail.com>
Subject: [PATCH] staging: rtl8192u: Fix type mismatch warnings reported by sparse
Date: Tue,  9 May 2017 15:17:56 +0530	[thread overview]
Message-ID: <1494323276-6419-1-git-send-email-suniel.spartan@gmail.com> (raw)

From: Suniel Mahesh <suniel.spartan@gmail.com>

The function Mk16_le() is calling le16_to_cpu()
internally. le16_to_cpu() takes an argument of type (__le *)
but the argument passed is of type (u16 *). Fixed it by passing
the correct argument type.

Signed-off-by: Suniel Mahesh <suniel.spartan@gmail.com>
---
 .../rtl8192u/ieee80211/ieee80211_crypt_tkip.c      | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
index 5039172..11ddf30 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
@@ -172,7 +172,7 @@ static inline u16 Mk16(u8 hi, u8 lo)
 }
 
 
-static inline u16 Mk16_le(u16 *v)
+static inline u16 Mk16_le(__le16 *v)
 {
 	return le16_to_cpu(*v);
 }
@@ -264,15 +264,15 @@ static void tkip_mixing_phase2(u8 *WEPSeed, const u8 *TK, const u16 *TTAK,
 	PPK[5] = TTAK[4] + IV16;
 
 	/* Step 2 - 96-bit bijective mixing using S-box */
-	PPK[0] += _S_(PPK[5] ^ Mk16_le((u16 *) &TK[0]));
-	PPK[1] += _S_(PPK[0] ^ Mk16_le((u16 *) &TK[2]));
-	PPK[2] += _S_(PPK[1] ^ Mk16_le((u16 *) &TK[4]));
-	PPK[3] += _S_(PPK[2] ^ Mk16_le((u16 *) &TK[6]));
-	PPK[4] += _S_(PPK[3] ^ Mk16_le((u16 *) &TK[8]));
-	PPK[5] += _S_(PPK[4] ^ Mk16_le((u16 *) &TK[10]));
-
-	PPK[0] += RotR1(PPK[5] ^ Mk16_le((u16 *) &TK[12]));
-	PPK[1] += RotR1(PPK[0] ^ Mk16_le((u16 *) &TK[14]));
+	PPK[0] += _S_(PPK[5] ^ Mk16_le((__le16 *)&TK[0]));
+	PPK[1] += _S_(PPK[0] ^ Mk16_le((__le16 *)&TK[2]));
+	PPK[2] += _S_(PPK[1] ^ Mk16_le((__le16 *)&TK[4]));
+	PPK[3] += _S_(PPK[2] ^ Mk16_le((__le16 *)&TK[6]));
+	PPK[4] += _S_(PPK[3] ^ Mk16_le((__le16 *)&TK[8]));
+	PPK[5] += _S_(PPK[4] ^ Mk16_le((__le16 *)&TK[10]));
+
+	PPK[0] += RotR1(PPK[5] ^ Mk16_le((__le16 *)&TK[12]));
+	PPK[1] += RotR1(PPK[0] ^ Mk16_le((__le16 *)&TK[14]));
 	PPK[2] += RotR1(PPK[1]);
 	PPK[3] += RotR1(PPK[2]);
 	PPK[4] += RotR1(PPK[3]);
@@ -285,7 +285,7 @@ static void tkip_mixing_phase2(u8 *WEPSeed, const u8 *TK, const u16 *TTAK,
 	WEPSeed[0] = Hi8(IV16);
 	WEPSeed[1] = (Hi8(IV16) | 0x20) & 0x7F;
 	WEPSeed[2] = Lo8(IV16);
-	WEPSeed[3] = Lo8((PPK[5] ^ Mk16_le((u16 *) &TK[0])) >> 1);
+	WEPSeed[3] = Lo8((PPK[5] ^ Mk16_le((__le16 *)&TK[0])) >> 1);
 
 #ifdef __BIG_ENDIAN
 	{
-- 
1.9.1

             reply	other threads:[~2017-05-09  9:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-09  9:47 suniel.spartan [this message]
2017-05-12  9:07 ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2017-05-01  7:49 suniel.spartan
2017-05-12  9:06 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1494323276-6419-1-git-send-email-suniel.spartan@gmail.com \
    --to=suniel.spartan@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sunil.m@techveda.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®