All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Removed unnecessary {} from conditional statements
@ 2015-02-22 10:28 Vatika Harlalka
  2015-02-23 21:51 ` [Outreachy kernel] " Arnd Bergmann
  0 siblings, 1 reply; 2+ messages in thread
From: Vatika Harlalka @ 2015-02-22 10:28 UTC (permalink / raw)
  To: outreachy-kernel

This patch is to remove unnecessary braces from single line
conditional statements to follow kernel coding conventions.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
---
 drivers/staging/rtl8188eu/hal/bb_cfg.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/bb_cfg.c b/drivers/staging/rtl8188eu/hal/bb_cfg.c
index 1e963bf..76d3db1 100644
--- a/drivers/staging/rtl8188eu/hal/bb_cfg.c
+++ b/drivers/staging/rtl8188eu/hal/bb_cfg.c
@@ -554,21 +554,20 @@ static void store_pwrindex_offset(struct adapter *Adapter, u32 regaddr, u32 bitm
 
 static void rtl_addr_delay(struct adapter *adapt, u32 addr, u32 bit_mask, u32 data)
 {
-	if (addr == 0xfe) {
+	if (addr == 0xfe)
 		msleep(50);
-	} else if (addr == 0xfd) {
+	else if (addr == 0xfd)
 		mdelay(5);
-	} else if (addr == 0xfc) {
+	else if (addr == 0xfc)
 		mdelay(1);
-	} else if (addr == 0xfb) {
+	else if (addr == 0xfb)
 		udelay(50);
-	} else if (addr == 0xfa) {
+	else if (addr == 0xfa)
 		udelay(5);
-	} else if (addr == 0xf9) {
+	else if (addr == 0xf9)
 		udelay(1);
-	} else{
+	else
 		store_pwrindex_offset(adapt, addr, bit_mask, data);
-	}
 }
 
 static bool config_bb_with_pgheader(struct adapter *adapt)
-- 
1.9.1



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

* Re: [Outreachy kernel] [PATCH] Removed unnecessary {} from conditional statements
  2015-02-22 10:28 [PATCH] Removed unnecessary {} from conditional statements Vatika Harlalka
@ 2015-02-23 21:51 ` Arnd Bergmann
  0 siblings, 0 replies; 2+ messages in thread
From: Arnd Bergmann @ 2015-02-23 21:51 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Vatika Harlalka

On Sunday 22 February 2015 15:58:30 Vatika Harlalka wrote:
>  static void rtl_addr_delay(struct adapter *adapt, u32 addr, u32 bit_mask, u32 data)
>  {
> -       if (addr == 0xfe) {
> +       if (addr == 0xfe)
>                 msleep(50);
> -       } else if (addr == 0xfd) {
> +       else if (addr == 0xfd)
>                 mdelay(5);
> -       } else if (addr == 0xfc) {
> +       else if (addr == 0xfc)
>                 mdelay(1);
> -       } else if (addr == 0xfb) {
> +       else if (addr == 0xfb)
>                 udelay(50);
> -       } else if (addr == 0xfa) {
> +       else if (addr == 0xfa)
>                 udelay(5);
> -       } else if (addr == 0xf9) {
> +       else if (addr == 0xf9)
>                 udelay(1);
> -       } else{
> +       else
>                 store_pwrindex_offset(adapt, addr, bit_mask, data);
> -       }
> 

Maybe use switch()/case instead?

	Arnd


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

end of thread, other threads:[~2015-02-23 21:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-22 10:28 [PATCH] Removed unnecessary {} from conditional statements Vatika Harlalka
2015-02-23 21:51 ` [Outreachy kernel] " Arnd Bergmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.