[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200330030303.024899f7@elisabeth>
Date: Mon, 30 Mar 2020 03:03:03 +0200
From: Stefano Brivio <sbrivio@...hat.com>
To: Simran Singhal <singhalsimran0@...il.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
outreachy-kernel <outreachy-kernel@...glegroups.com>
Subject: Re: [Outreachy kernel] [PATCH] staging: rtl8723bs: Remove
unnecessary braces for single statements
On Wed, 25 Mar 2020 19:32:45 +0530
Simran Singhal <singhalsimran0@...il.com> wrote:
> Clean up unnecessary braces around single statement blocks.
> Issues reported by checkpatch.pl as:
> WARNING: braces {} are not necessary for single statement blocks
>
> Signed-off-by: Simran Singhal <singhalsimran0@...il.com>
> ---
> drivers/staging/rtl8723bs/core/rtw_efuse.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_efuse.c b/drivers/staging/rtl8723bs/core/rtw_efuse.c
> index bdb6ff8aab7d..de7d15fdc936 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_efuse.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_efuse.c
> @@ -43,9 +43,8 @@ Efuse_Read1ByteFromFakeContent(
> u16 Offset,
> u8 *Value)
> {
> - if (Offset >= EFUSE_MAX_HW_SIZE) {
> + if (Offset >= EFUSE_MAX_HW_SIZE)
> return false;
> - }
> /* DbgPrint("Read fake content, offset = %d\n", Offset); */
I find the resulting version a bit confusing:
if (Offset >= EFUSE_MAX_HW_SIZE)
return false;
/* DbgPrint("Read fake content, offset = %d\n", Offset); */
if (fakeEfuseBank == 0)
*Value = fakeEfuseContent[Offset];
The check on "Offset" isn't separated in any way by the following
logic. I would suggest that you replace the closing brace by a newline,
also for the other cases you're fixing up here:
if (Offset >= EFUSE_MAX_HW_SIZE)
return false;
/* DbgPrint("Read fake content, offset = %d\n", Offset); */
...
--
Stefano
Powered by blists - more mailing lists