linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/2] rtlwifi: Fix improve function 'rtl_addr_delay()' in core.c
@ 2016-02-03  2:15 ` Byeoungwook Kim
  2016-02-03  3:40   ` [PATCH] rtlwifi: fix semicolon.cocci warnings kbuild test robot
  0 siblings, 1 reply; 4+ messages in thread
From: Byeoungwook Kim @ 2016-02-03  2:15 UTC (permalink / raw)
  To: Larry.Finger; +Cc: kvalo, chaoming_li, linux-wireless, netdev, linux-kernel

Conditional codes in rtl_addr_delay() were improved in readability and
performance by using switch codes.

Signed-off-by: Byeoungwook Kim <quddnr145@gmail.com>
Reviewed-by: Julian Calaby <julian.calaby@gmail.com>
---
V2 split in separate patchs.
 drivers/net/wireless/realtek/rtlwifi/core.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/core.c b/drivers/net/wireless/realtek/rtlwifi/core.c
index 4ae421e..05f432c 100644
--- a/drivers/net/wireless/realtek/rtlwifi/core.c
+++ b/drivers/net/wireless/realtek/rtlwifi/core.c
@@ -37,18 +37,26 @@
 
 void rtl_addr_delay(u32 addr)
 {
-	if (addr == 0xfe)
+	switch (addr) {
+	case 0xfe:
 		mdelay(50);
-	else if (addr == 0xfd)
+		break;
+	case 0xfd:
 		mdelay(5);
-	else if (addr == 0xfc)
+		break;
+	case 0xfc:
 		mdelay(1);
-	else if (addr == 0xfb)
+		break;
+	case 0xfb:
 		udelay(50);
-	else if (addr == 0xfa)
+		break;
+	case 0xfa:
 		udelay(5);
-	else if (addr == 0xf9)
+		break;
+	case 0xf9:
 		udelay(1);
+		break;
+	};
 }
 EXPORT_SYMBOL(rtl_addr_delay);
 
-- 
2.5.0

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

* [PATCH] rtlwifi: fix semicolon.cocci warnings
  2016-02-03  2:15 ` Byeoungwook Kim
@ 2016-02-03  3:40   ` kbuild test robot
  2016-02-03  6:06     ` Larry Finger
  0 siblings, 1 reply; 4+ messages in thread
From: kbuild test robot @ 2016-02-03  3:40 UTC (permalink / raw)
  To: Byeoungwook Kim
  Cc: kbuild-all, Larry.Finger, kvalo, chaoming_li, linux-wireless,
	netdev, linux-kernel

drivers/net/wireless/realtek/rtlwifi/core.c:59:2-3: Unneeded semicolon


 Remove unneeded semicolon.

Generated by: scripts/coccinelle/misc/semicolon.cocci

CC: Byeoungwook Kim <quddnr145@gmail.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

 core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/wireless/realtek/rtlwifi/core.c
+++ b/drivers/net/wireless/realtek/rtlwifi/core.c
@@ -56,7 +56,7 @@ void rtl_addr_delay(u32 addr)
 	case 0xf9:
 		udelay(1);
 		break;
-	};
+	}
 }
 EXPORT_SYMBOL(rtl_addr_delay);
 

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

* Re: [PATCH v2 1/2] rtlwifi: Fix improve function 'rtl_addr_delay()' in core.c
  2016-02-03  2:15 ` Byeoungwook Kim
@ 2016-02-03  3:40 kbuild test robot
  2016-02-03  2:15 ` Byeoungwook Kim
  0 siblings, 1 reply; 4+ messages in thread
From: kbuild test robot @ 2016-02-03  3:40 UTC (permalink / raw)
  To: Byeoungwook Kim
  Cc: kbuild-all, Larry.Finger, kvalo, chaoming_li, linux-wireless,
	netdev, linux-kernel

Hi Byeoungwook,

[auto build test WARNING on wireless-drivers-next/master]
[also build test WARNING on v4.5-rc2 next-20160202]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]

url:    https://github.com/0day-ci/linux/commits/Byeoungwook-Kim/rtlwifi-Fix-improve-function-rtl_addr_delay-in-core-c/20160203-101854
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git master


coccinelle warnings: (new ones prefixed by >>)

>> drivers/net/wireless/realtek/rtlwifi/core.c:59:2-3: Unneeded semicolon

Please review and possibly fold the followup patch.

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

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

* Re: [PATCH] rtlwifi: fix semicolon.cocci warnings
  2016-02-03  3:40   ` [PATCH] rtlwifi: fix semicolon.cocci warnings kbuild test robot
@ 2016-02-03  6:06     ` Larry Finger
  0 siblings, 0 replies; 4+ messages in thread
From: Larry Finger @ 2016-02-03  6:06 UTC (permalink / raw)
  To: kbuild test robot, Byeoungwook Kim
  Cc: kbuild-all, kvalo, chaoming_li, linux-wireless, netdev, linux-kernel

On 02/02/2016 09:40 PM, kbuild test robot wrote:
> drivers/net/wireless/realtek/rtlwifi/core.c:59:2-3: Unneeded semicolon
>
>
>   Remove unneeded semicolon.
>
> Generated by: scripts/coccinelle/misc/semicolon.cocci
>
> CC: Byeoungwook Kim <quddnr145@gmail.com>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> ---

Acked-by: Larry Finger <Larry.Finger@lwfinger.net>

Thanks,

Larry

>
>   core.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- a/drivers/net/wireless/realtek/rtlwifi/core.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/core.c
> @@ -56,7 +56,7 @@ void rtl_addr_delay(u32 addr)
>   	case 0xf9:
>   		udelay(1);
>   		break;
> -	};
> +	}
>   }
>   EXPORT_SYMBOL(rtl_addr_delay);
>
>

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

end of thread, other threads:[~2016-02-03  6:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-03  3:40 [PATCH v2 1/2] rtlwifi: Fix improve function 'rtl_addr_delay()' in core.c kbuild test robot
2016-02-03  2:15 ` Byeoungwook Kim
2016-02-03  3:40   ` [PATCH] rtlwifi: fix semicolon.cocci warnings kbuild test robot
2016-02-03  6:06     ` Larry Finger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).