lkml.org 
[lkml]   [2022]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 6/6] staging: r8188eu: remove local BIT macro
On Tue, Mar 15, 2022 at 09:50:41PM +0100, Martin Kaiser wrote:
> The r8188eu driver defines a local BIT(x) macro. Remove this local macro
> and use the one from include/linux/bits.h.
>
> The global BIT macro returns an unsigned long value. Therefore, we have to
> cast DYNAMIC_BB_DYNAMIC_TXPWR to u32 explicitly. This define is used with
> the bitwise not operator.

It doesn't change run time at all if you leave it as unsigned long.
I don't know if there are static checkers which care, but if there are
then those checkers are wrong. It's nicer to not have the unnecesary
cast.

Also in the original code the type was int so the negative bit would
have been sign extended if we cast it to unsigned long.

regards,
dan carpenter

\
 
 \ /
  Last update: 2022-09-17 16:17    [W:0.105 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site