LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Aakash Hemadri <aakashhemadri123@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Shuah Khan <skhan@linuxfoundation.org>,
	Bjorn Helgaas <bjorn@helgaas.com>,
	linux-staging@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] staging: rtl8723bs: fix cast to restricted __le32
Date: Mon, 16 Aug 2021 23:00:43 +0530	[thread overview]
Message-ID: <1be80f0196bed681bf55bfe3155f564b4ebf3b76.1629134725.git.aakashhemadri123@gmail.com> (raw)
In-Reply-To: <cover.1629134725.git.aakashhemadri123@gmail.com>

Fix sparse warning:
warning: cast to restricted __le32

Signed-off-by: Aakash Hemadri <aakashhemadri123@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_security.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_security.c b/drivers/staging/rtl8723bs/core/rtw_security.c
index 381deeea99d0..5320b1a46dfb 100644
--- a/drivers/staging/rtl8723bs/core/rtw_security.c
+++ b/drivers/staging/rtl8723bs/core/rtw_security.c
@@ -122,7 +122,7 @@ void rtw_wep_decrypt(struct adapter  *padapter, u8 *precvframe)
 		arc4_crypt(ctx, payload, payload,  length);
 
 		/* calculate icv and compare the icv */
-		*((u32 *)crc) = le32_to_cpu(~crc32_le(~0, payload, length - 4));
+		*((u32 *)crc) = ~crc32_le(~0, payload, length - 4);
 
 	}
 }
@@ -621,7 +621,7 @@ u32 rtw_tkip_decrypt(struct adapter *padapter, u8 *precvframe)
 			arc4_setkey(ctx, rc4key, 16);
 			arc4_crypt(ctx, payload, payload, length);
 
-			*((u32 *)crc) = le32_to_cpu(~crc32_le(~0, payload, length - 4));
+			*((u32 *)crc) = ~crc32_le(~0, payload, length - 4);
 
 			if (crc[3] != payload[length - 1] || crc[2] != payload[length - 2] ||
 			    crc[1] != payload[length - 3] || crc[0] != payload[length - 4])
-- 
2.32.0


  parent reply	other threads:[~2021-08-16 17:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-16 17:30 [PATCH 0/2] staging: rtl8732bs: Fix sparse warnings Aakash Hemadri
2021-08-16 17:30 ` [PATCH 1/2] staging: rtl8732bs: incorrect type in assignment Aakash Hemadri
2021-08-16 17:30 ` Aakash Hemadri [this message]
2021-08-17 17:54 ` [PATCH 0/2] staging: rtl8732bs: Fix sparse warnings Greg Kroah-Hartman
2021-08-17 19:10   ` Fabio M. De Francesco
2021-08-18  4:42     ` Aakash Hemadri
2021-08-18  4:40   ` Aakash Hemadri
2021-08-16 17:35 Aakash Hemadri
2021-08-16 17:35 ` [PATCH 2/2] staging: rtl8723bs: fix cast to restricted __le32 Aakash Hemadri
2021-08-19  9:43   ` David Laight

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=1be80f0196bed681bf55bfe3155f564b4ebf3b76.1629134725.git.aakashhemadri123@gmail.com \
    --to=aakashhemadri123@gmail.com \
    --cc=bjorn@helgaas.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@vger.kernel.org \
    --cc=skhan@linuxfoundation.org \
    --subject='Re: [PATCH 2/2] staging: rtl8723bs: fix cast to restricted __le32' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).