[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a88dd19ab97721a2db228bb070c8eb5d80751e7f.camel@perches.com>
Date: Thu, 20 Jul 2023 23:34:15 -0700
From: Joe Perches <joe@...ches.com>
To: Dan Carpenter <dan.carpenter@...aro.org>,
Sergey Rozhnov <rozhnov.sergey.89@...il.com>
Cc: Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: rtl8712: Remove redundant braces in if
statements
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.
Powered by blists - more mailing lists