Search Linux Wireless

Re: [PATCH 4/4] wifi: rt2x00: fix __le32 sparse warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Stanislaw Gruszka <stf_xl@xxxxx> writes:

> On Wed, Jan 31, 2024 at 09:48:44AM +0200, Kalle Valo wrote:
>> Kalle Valo <kvalo@xxxxxxxxxx> writes:
>> 
>> > Sparse warns:
>> >
>> > drivers/net/wireless/ralink/rt2x00/rt2800lib.c:10949:39: warning: incorrect type in assignment (different base types)
>> > drivers/net/wireless/ralink/rt2x00/rt2800lib.c:10949:39:    expected unsigned int [usertype]
>> > drivers/net/wireless/ralink/rt2x00/rt2800lib.c:10949:39:    got restricted __le32 [usertype]
>> > drivers/net/wireless/ralink/rt2x00/rt2800lib.c:10951:43: warning: incorrect type in assignment (different base types)
>> > drivers/net/wireless/ralink/rt2x00/rt2800lib.c:10951:43:    expected unsigned int [usertype]
>> > drivers/net/wireless/ralink/rt2x00/rt2800lib.c:10951:43:    got restricted __le32 [usertype]
>> > drivers/net/wireless/ralink/rt2x00/rt2800lib.c:10953:43: warning: incorrect type in assignment (different base types)
>> > drivers/net/wireless/ralink/rt2x00/rt2800lib.c:10953:43:    expected unsigned int [usertype]
>> > drivers/net/wireless/ralink/rt2x00/rt2800lib.c:10953:43:    got restricted __le32 [usertype]
>> > drivers/net/wireless/ralink/rt2x00/rt2800lib.c:10955:43: warning: incorrect type in assignment (different base types)
>> > drivers/net/wireless/ralink/rt2x00/rt2800lib.c:10955:43:    expected unsigned int [usertype]
>> > drivers/net/wireless/ralink/rt2x00/rt2800lib.c:10955:43:    got restricted __le32 [usertype]
>> >
>> > rt2x00 does some wicked casting here so no wonder sparse warns. Clean that up
>> > and use cpu_to_le16() to avoid any warnings.
>> >
>> > Compile tested only.
>> >
>> > Signed-off-by: Kalle Valo <kvalo@xxxxxxxxxx>
>> 
>> Stanislaw, sorry somehow I corrupted your address but fixed it now. Let
>> me know what you think, patch here:
>> 
>> https://patchwork.kernel.org/project/linux-wireless/patch/20240130151556.2315951-5-kvalo@xxxxxxxxxx/
>
> If I analyse it correctly, patch is not ok on Big Endian machines
> where we do bytes swapping.

Ouch, thanks for catching this. Johannes sent a new version:

https://patchwork.kernel.org/project/linux-wireless/patch/20240223114023.ce0c714124e9.I2b5710b761f63522574fbe7654d37151c31e0b77@changeid/

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux