Thread (48 messages) 48 messages, 7 authors, 2016-04-26

Re: [PATCH MOREWORK 16/19] rtlwifi: Implement 'rtl_addr_delay()' with a switch statement

From: Larry Finger <hidden>
Date: 2016-03-18 02:38:12

On 03/17/2016 09:28 PM, Julian Calaby wrote:
From: Byeoungwook Kim <redacted>

Doing it this way improves readability.

Signed-off-by: Byeoungwook Kim <redacted>
[Rewrote commit message]
Signed-off-by: Julian Calaby <redacted>

---

... or does it.

Honesltly, this is only in this list as Byeoungwook asked about it and I
can see _some_ sort of reason why it exists.

Larry, if you don't like this, please NACK it and we'll never speak of it
again.

Thanks,

Julian Calaby
---
  drivers/net/wireless/realtek/rtlwifi/core.c | 20 ++++++++++++++------
  1 file changed, 14 insertions(+), 6 deletions(-)
I thought I had already NACKed it, but just in case:

NACK.

Larry
quoted hunk ↗ jump to hunk
diff --git a/drivers/net/wireless/realtek/rtlwifi/core.c b/drivers/net/wireless/realtek/rtlwifi/core.c
index 0f48048..1cf367f 100644
--- a/drivers/net/wireless/realtek/rtlwifi/core.c
+++ b/drivers/net/wireless/realtek/rtlwifi/core.c
@@ -53,18 +53,26 @@ EXPORT_SYMBOL(channel5g_80m);

  void rtl_addr_delay(u32 addr)
  {
-	if (addr == 0xfe)
+	switch (addr) {
+	case 0xfe:
  		msleep(50);
-	else if (addr == 0xfd)
+		break;
+	case 0xfd:
  		msleep(5);
-	else if (addr == 0xfc)
+		break;
+	case 0xfc:
  		msleep(1);
-	else if (addr == 0xfb)
+		break;
+	case 0xfb:
  		usleep_range(50, 100);
-	else if (addr == 0xfa)
+		break;
+	case 0xfa:
  		usleep_range(5, 10);
-	else if (addr == 0xf9)
+		break;
+	case 0xf9:
  		usleep_range(1, 2);
+		break;
+	}
  }
  EXPORT_SYMBOL(rtl_addr_delay);
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help