2021-08-16 17:32:47

by Aakash Hemadri

[permalink] [raw]
Subject: [PATCH 0/2] staging: rtl8732bs: Fix sparse warnings

This patchset fixes the below sparse warnings

rtw_security.c:72:50: warning: incorrect type in assignment (different base types)
rtw_security.c:72:50: expected restricted __le32 [usertype]
rtw_security.c:72:50: got unsigned int
rtw_security.c:80:50: warning: incorrect type in assignment (different base types)
rtw_security.c:80:50: expected restricted __le32 [usertype]
rtw_security.c:80:50: got unsigned int
rtw_security.c:124:33: warning: cast to restricted __le32
rtw_security.c:509:58: warning: incorrect type in assignment (different base types)
rtw_security.c:509:58: expected restricted __le32 [usertype]
rtw_security.c:509:58: got unsigned int
rtw_security.c:517:58: warning: incorrect type in assignment (different base types)
rtw_security.c:517:58: expected restricted __le32 [usertype]
rtw_security.c:517:58: got unsigned int
rtw_security.c:621:41: warning: cast to restricted __le32

This can be applied cleanly on next-20210816, and is compile tested.

Aakash Hemadri (2):
staging: rtl8732bs: incorrect type in assignment
staging: rtl8723bs: cast to restricted __le32

rtw_security.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)

--
2.32.0


2021-08-16 17:33:48

by Aakash Hemadri

[permalink] [raw]
Subject: [PATCH 2/2] staging: rtl8723bs: fix cast to restricted __le32

Fix sparse warning:
warning: cast to restricted __le32

Signed-off-by: Aakash Hemadri <[email protected]>
---
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

2021-08-17 17:56:02

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 0/2] staging: rtl8732bs: Fix sparse warnings

On Mon, Aug 16, 2021 at 11:00:41PM +0530, Aakash Hemadri wrote:
> This patchset fixes the below sparse warnings
>
> rtw_security.c:72:50: warning: incorrect type in assignment (different base types)
> rtw_security.c:72:50: expected restricted __le32 [usertype]
> rtw_security.c:72:50: got unsigned int
> rtw_security.c:80:50: warning: incorrect type in assignment (different base types)
> rtw_security.c:80:50: expected restricted __le32 [usertype]
> rtw_security.c:80:50: got unsigned int
> rtw_security.c:124:33: warning: cast to restricted __le32
> rtw_security.c:509:58: warning: incorrect type in assignment (different base types)
> rtw_security.c:509:58: expected restricted __le32 [usertype]
> rtw_security.c:509:58: got unsigned int
> rtw_security.c:517:58: warning: incorrect type in assignment (different base types)
> rtw_security.c:517:58: expected restricted __le32 [usertype]
> rtw_security.c:517:58: got unsigned int
> rtw_security.c:621:41: warning: cast to restricted __le32
>
> This can be applied cleanly on next-20210816, and is compile tested.
>
> Aakash Hemadri (2):
> staging: rtl8732bs: incorrect type in assignment
> staging: rtl8723bs: cast to restricted __le32
>
> rtw_security.c | 15 +++++++++------
> 1 file changed, 9 insertions(+), 6 deletions(-)

This series does not apply to my tree at all. Please fix up and rebase
and resubmit, after reading the mailing list archives for others that
have attempted do do this type of work in the past for this issue.

It is not a trivial change that is needed...

thanks,

greg k-h

2021-08-17 19:11:20

by Fabio M. De Francesco

[permalink] [raw]
Subject: Re: [PATCH 0/2] staging: rtl8732bs: Fix sparse warnings

On Tuesday, August 17, 2021 7:54:11 PM CEST Greg Kroah-Hartman wrote:
> On Mon, Aug 16, 2021 at 11:00:41PM +0530, Aakash Hemadri wrote:
> > This patchset fixes the below sparse warnings
> >
> > rtw_security.c:72:50: warning: incorrect type in assignment (different base types)
> > rtw_security.c:72:50: expected restricted __le32 [usertype]
> > rtw_security.c:72:50: got unsigned int
> >
> > [...]
>
> This series does not apply to my tree at all. Please fix up and rebase
> and resubmit, after reading the mailing list archives for others that
> have attempted do do this type of work in the past for this issue.
>
> It is not a trivial change that is needed...

Dear Greg,

As I've already pointed out in another message of this thread, your tree has
already these sparse warnings fixed by me with commit aef1c966a364 (that
you applied with a "much nicer!" comment).

So, when Aakash rebases against your current tree, he will not anymore see
those sparse warnings.

Thanks,

Fabio


>
> thanks,
>
> greg k-h
>




2021-08-18 04:43:53

by Aakash Hemadri

[permalink] [raw]
Subject: Re: [PATCH 0/2] staging: rtl8732bs: Fix sparse warnings

On 21/08/17 07:54PM, Greg Kroah-Hartman wrote:
> This series does not apply to my tree at all. Please fix up and rebase
> and resubmit, after reading the mailing list archives for others that
> have attempted do do this type of work in the past for this issue.
>
> It is not a trivial change that is needed...

Will check what went wrong, and see what I can do.

Thanks,
Aakash Hemadri

2021-08-18 04:44:30

by Aakash Hemadri

[permalink] [raw]
Subject: Re: [PATCH 0/2] staging: rtl8732bs: Fix sparse warnings

On 21/08/17 09:10PM, Fabio M. De Francesco wrote:
> On Tuesday, August 17, 2021 7:54:11 PM CEST Greg Kroah-Hartman wrote:
> > On Mon, Aug 16, 2021 at 11:00:41PM +0530, Aakash Hemadri wrote:
> > > This patchset fixes the below sparse warnings
> > >
> > > rtw_security.c:72:50: warning: incorrect type in assignment (different base types)
> > > rtw_security.c:72:50: expected restricted __le32 [usertype]
> > > rtw_security.c:72:50: got unsigned int
> > >
> > > [...]
> >
> > This series does not apply to my tree at all. Please fix up and rebase
> > and resubmit, after reading the mailing list archives for others that
> > have attempted do do this type of work in the past for this issue.
> >
> > It is not a trivial change that is needed...
>
> Dear Greg,
>
> As I've already pointed out in another message of this thread, your tree has
> already these sparse warnings fixed by me with commit aef1c966a364 (that
> you applied with a "much nicer!" comment).
>
> So, when Aakash rebases against your current tree, he will not anymore see
> those sparse warnings.

Thanks for the patch Fabio! Will rebase and work on something new!

Thanks,
Aakash Hemadri