Search Linux Wireless

Re: [PATCH wireless-next 2/2] rtlwifi: rtl8821ae: phy: fix an undefined bitwise shift behavior

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

 



On 2023/11/23 08:41, Ping-Ke Shih wrote:

-----Original Message-----
From: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Sent: Wednesday, November 22, 2023 9:02 PM
To: Su Hui <suhui@xxxxxxxxxxxx>
Cc: Ping-Ke Shih <pkshih@xxxxxxxxxxx>; kvalo@xxxxxxxxxx; nathan@xxxxxxxxxx; ndesaulniers@xxxxxxxxxx;
trix@xxxxxxxxxx; lizetao1@xxxxxxxxxx; linville@xxxxxxxxxxxxx; Larry.Finger@xxxxxxxxxxxx;
linux-wireless@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; llvm@xxxxxxxxxxxxxxx;
kernel-janitors@xxxxxxxxxxxxxxx
Subject: Re: [PATCH wireless-next 2/2] rtlwifi: rtl8821ae: phy: fix an undefined bitwise shift behavior

Perhaps, a better way to silence the warning is to just change
_rtl8821ae_phy_calculate_bit_shift() to not return 32 bits?  Do we
really ever pass bitmask 0?  No idea...

I think the bitmask should not 0, so just replace _rtl8821ae_phy_calculate_bit_shift()
by __ffs(bitmask). To be safer, callers can check bitmask is not 0 before calling.
Thanks for your great suggestion!
I will send v2 soon.

Su Hui





[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