The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8723bs: simplify if-else block by removing unnecessary braces
@ 2025-03-25 13:11 Abraham Samuel Adekunle
  2025-03-25 13:56 ` Julia Lawall
  0 siblings, 1 reply; 2+ messages in thread
From: Abraham Samuel Adekunle @ 2025-03-25 13:11 UTC (permalink / raw)
  To: Greg Kroah-Hartman, outreachy, Julia Lawall; +Cc: linux-staging, linux-kernel

The if-else block contained braces around single statements, which are
unnecessary according to the Linux kernel coding style.

Remove the redundant braces to improve code readability and maintain
consistency with the rest of the codebase.

Reported by checkpatch:

WARNING: braces {} are not necessary for any arm of this statement

Signed-off-by: Abraham Samuel Adekunle <abrahamadekunle50@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_ieee80211.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
index 0ed420f3d096..53d4c113b19c 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
@@ -988,11 +988,10 @@ void rtw_macaddr_cfg(struct device *dev, u8 *mac_addr)
 	if (is_broadcast_ether_addr(mac) || is_zero_ether_addr(mac)) {
 		addr = of_get_property(np, "local-mac-address", &len);
 
-		if (addr && len == ETH_ALEN) {
+		if (addr && len == ETH_ALEN)
 			ether_addr_copy(mac_addr, addr);
-		} else {
+		else
 			eth_random_addr(mac_addr);
-		}
 	}
 }
 
-- 
2.34.1


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

* Re: [PATCH] staging: rtl8723bs: simplify if-else block by removing unnecessary braces
  2025-03-25 13:11 [PATCH] staging: rtl8723bs: simplify if-else block by removing unnecessary braces Abraham Samuel Adekunle
@ 2025-03-25 13:56 ` Julia Lawall
  0 siblings, 0 replies; 2+ messages in thread
From: Julia Lawall @ 2025-03-25 13:56 UTC (permalink / raw)
  To: Abraham Samuel Adekunle
  Cc: Greg Kroah-Hartman, outreachy, linux-staging, linux-kernel



On Tue, 25 Mar 2025, Abraham Samuel Adekunle wrote:

> The if-else block contained braces around single statements, which are
> unnecessary according to the Linux kernel coding style.
>
> Remove the redundant braces to improve code readability and maintain
> consistency with the rest of the codebase.
>
> Reported by checkpatch:
>
> WARNING: braces {} are not necessary for any arm of this statement
>
> Signed-off-by: Abraham Samuel Adekunle <abrahamadekunle50@gmail.com>

Reviewed-by: Julia Lawall <julia.lawall@inria.fr>

> ---
>  drivers/staging/rtl8723bs/core/rtw_ieee80211.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
> index 0ed420f3d096..53d4c113b19c 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
> @@ -988,11 +988,10 @@ void rtw_macaddr_cfg(struct device *dev, u8 *mac_addr)
>  	if (is_broadcast_ether_addr(mac) || is_zero_ether_addr(mac)) {
>  		addr = of_get_property(np, "local-mac-address", &len);
>
> -		if (addr && len == ETH_ALEN) {
> +		if (addr && len == ETH_ALEN)
>  			ether_addr_copy(mac_addr, addr);
> -		} else {
> +		else
>  			eth_random_addr(mac_addr);
> -		}
>  	}
>  }
>
> --
> 2.34.1
>
>

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

end of thread, other threads:[~2025-03-25 13:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-25 13:11 [PATCH] staging: rtl8723bs: simplify if-else block by removing unnecessary braces Abraham Samuel Adekunle
2025-03-25 13:56 ` Julia Lawall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox