lkml.org 
[lkml]   [2023]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] staging: rtl8712: Remove redundant braces in if statements
From
Date
On Fri, 2023-07-21 at 09:01 +0300, Dan Carpenter wrote:
> On Fri, Jul 21, 2023 at 06:05:57AM +0400, Sergey Rozhnov wrote:
> > Extract masked value to improve readability, apply fix suggested by checkpatch.
> > ---
>
> I like the new format, but you need to run checkpatch on your patches.
>

True, but this does only 1 of 2 very similar functions.
Ideally both would be done at the same time.

My preference would be to remove the int i and just
dereference rate similar to:

uint r8712_is_cckrates_included(u8 *rate)
{
while (*rate) {
u8 r = *rate & 0x7f;

if (r == 2 || r == 4 || r == 11 || r == 22)
return true;
rate++;
}

return false;
}

uint r8712_is_cckratesonly_included(u8 *rate)
{
while (*rate) {
u8 r = *rate & 0x7f;

if (r != 2 && r != 4 && r != 11 && r != 22)
return false;
rate++;
}

return true;
}

though the existing cckratesonly_included function
seemingly returns an incorrect true if the rate array
is empty.


\
 
 \ /
  Last update: 2023-07-21 08:35    [W:0.099 / U:0.288 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site