DriverDev-Devel Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] staging: rtl8723bs: Remove unnecessary braces for single statements
@ 2020-03-25 14:02 Simran Singhal
  2020-03-30  1:03 ` [Outreachy kernel] " Stefano Brivio
  0 siblings, 1 reply; 2+ messages in thread
From: Simran Singhal @ 2020-03-25 14:02 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, linux-kernel, outreachy-kernel

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@gmail.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); */
 	if (fakeEfuseBank == 0)
 		*Value = fakeEfuseContent[Offset];
@@ -65,14 +64,12 @@ Efuse_Write1ByteToFakeContent(
 	u16 	Offset,
 	u8 Value)
 {
-	if (Offset >= EFUSE_MAX_HW_SIZE) {
+	if (Offset >= EFUSE_MAX_HW_SIZE)
 		return false;
-	}
 	if (fakeEfuseBank == 0)
 		fakeEfuseContent[Offset] = Value;
-	else {
+	else
 		fakeBTEfuseContent[fakeEfuseBank-1][Offset] = Value;
-	}
 	return true;
 }
 
-- 
2.17.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Outreachy kernel] [PATCH] staging: rtl8723bs: Remove unnecessary braces for single statements
  2020-03-25 14:02 [PATCH] staging: rtl8723bs: Remove unnecessary braces for single statements Simran Singhal
@ 2020-03-30  1:03 ` " Stefano Brivio
  0 siblings, 0 replies; 2+ messages in thread
From: Stefano Brivio @ 2020-03-30  1:03 UTC (permalink / raw)
  To: Simran Singhal; +Cc: devel, Greg Kroah-Hartman, linux-kernel, outreachy-kernel

On Wed, 25 Mar 2020 19:32:45 +0530
Simran Singhal <singhalsimran0@gmail.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@gmail.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

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-25 14:02 [PATCH] staging: rtl8723bs: Remove unnecessary braces for single statements Simran Singhal
2020-03-30  1:03 ` [Outreachy kernel] " Stefano Brivio

DriverDev-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/driverdev-devel/0 driverdev-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 driverdev-devel driverdev-devel/ https://lore.kernel.org/driverdev-devel \
		driverdev-devel@linuxdriverproject.org devel@driverdev.osuosl.org
	public-inbox-index driverdev-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.linuxdriverproject.driverdev-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git