[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <99ec66d717b249e781f9316cbd689521@realtek.com>
Date: Thu, 23 Nov 2023 00:41:39 +0000
From: Ping-Ke Shih <pkshih@...ltek.com>
To: Dan Carpenter <dan.carpenter@...aro.org>,
Su Hui <suhui@...china.com>
CC: "kvalo@...nel.org" <kvalo@...nel.org>,
"nathan@...nel.org" <nathan@...nel.org>,
"ndesaulniers@...gle.com" <ndesaulniers@...gle.com>,
"trix@...hat.com" <trix@...hat.com>,
"lizetao1@...wei.com" <lizetao1@...wei.com>,
"linville@...driver.com" <linville@...driver.com>,
"Larry.Finger@...inger.net" <Larry.Finger@...inger.net>,
"linux-wireless@...r.kernel.org" <linux-wireless@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"llvm@...ts.linux.dev" <llvm@...ts.linux.dev>,
"kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>
Subject: RE: [PATCH wireless-next 2/2] rtlwifi: rtl8821ae: phy: fix an undefined bitwise shift behavior
> -----Original Message-----
> From: Dan Carpenter <dan.carpenter@...aro.org>
> Sent: Wednesday, November 22, 2023 9:02 PM
> To: Su Hui <suhui@...china.com>
> Cc: Ping-Ke Shih <pkshih@...ltek.com>; kvalo@...nel.org; nathan@...nel.org; ndesaulniers@...gle.com;
> trix@...hat.com; lizetao1@...wei.com; linville@...driver.com; Larry.Finger@...inger.net;
> linux-wireless@...r.kernel.org; linux-kernel@...r.kernel.org; llvm@...ts.linux.dev;
> kernel-janitors@...r.kernel.org
> 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.
Ping-Ke
Powered by blists - more mailing lists