staging: rtl8723bs: simplify if-else block by removing unnecessary braces
authorAbraham Samuel Adekunle <abrahamadekunle50@gmail.com>
Tue, 25 Mar 2025 13:11:04 +0000 (14:11 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Apr 2025 05:38:08 +0000 (06:38 +0100)
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>
Link: https://lore.kernel.org/r/Z+KraOo2DfmH5zMX@HP-650
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723bs/core/rtw_ieee80211.c

index 0ed420f3d09628a5f73d4188b018d6cd27c8b59d..53d4c113b19c8c0a00435e678b6f0e79e917ecbd 100644 (file)
@@ -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);
-               }
        }
 }