* [PATCH] Staging: wlan-ng: Remove redundant break/goto statements in hfa384x_usb.c
@ 2014-09-08 12:48 Ilja Sidoroff
2014-09-08 13:47 ` Joe Perches
0 siblings, 1 reply; 3+ messages in thread
From: Ilja Sidoroff @ 2014-09-08 12:48 UTC (permalink / raw)
To: greg; +Cc: linux-kernel, Ilja Sidoroff
This patch removes redundant goto or break statements in hfa384x_usb.c as found by checkpatch.pl
Signed-off-by: Ilja Sidoroff <ilja.sidoroff@iki.fi>
---
drivers/staging/wlan-ng/hfa384x_usb.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c
index 2f63e0c..7f4ca1b 100644
--- a/drivers/staging/wlan-ng/hfa384x_usb.c
+++ b/drivers/staging/wlan-ng/hfa384x_usb.c
@@ -3528,7 +3528,6 @@ static void hfa384x_usbin_rx(wlandevice_t *wlandev, struct sk_buff *skb)
netdev_warn(hw->wlandev->netdev, "Received frame on unsupported port=%d\n",
HFA384x_RXSTATUS_MACPORT_GET(
usbin->rxfrm.desc.status));
- goto done;
break;
}
@@ -4127,7 +4126,6 @@ static int hfa384x_isgood_pdrcode(u16 pdrcode)
case HFA384x_PDR_HFA3861_MANF_TESTI:
/* code is OK */
return 1;
- break;
default:
if (pdrcode < 0x1000) {
/* code is OK, but we don't know exactly what it is */
@@ -4140,7 +4138,6 @@ static int hfa384x_isgood_pdrcode(u16 pdrcode)
pdrcode);
return 0;
}
- break;
}
return 0; /* avoid compiler warnings */
}
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] Staging: wlan-ng: Remove redundant break/goto statements in hfa384x_usb.c
2014-09-08 12:48 [PATCH] Staging: wlan-ng: Remove redundant break/goto statements in hfa384x_usb.c Ilja Sidoroff
@ 2014-09-08 13:47 ` Joe Perches
2014-09-08 14:37 ` [PATCH v2] " Ilja Sidoroff
0 siblings, 1 reply; 3+ messages in thread
From: Joe Perches @ 2014-09-08 13:47 UTC (permalink / raw)
To: Ilja Sidoroff; +Cc: greg, linux-kernel
On Mon, 2014-09-08 at 15:48 +0300, Ilja Sidoroff wrote:
> This patch removes redundant goto or break statements in hfa384x_usb.c as found by checkpatch.pl
[]
> diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c
[]
> @@ -3528,7 +3528,6 @@ static void hfa384x_usbin_rx(wlandevice_t *wlandev, struct sk_buff *skb)
> netdev_warn(hw->wlandev->netdev, "Received frame on unsupported port=%d\n",
> HFA384x_RXSTATUS_MACPORT_GET(
> usbin->rxfrm.desc.status));
> - goto done;
> break;
> }
Better still to change the other use of "goto done" to
"break" and then remove the done label altogether.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2] Staging: wlan-ng: Remove redundant break/goto statements in hfa384x_usb.c
2014-09-08 13:47 ` Joe Perches
@ 2014-09-08 14:37 ` Ilja Sidoroff
0 siblings, 0 replies; 3+ messages in thread
From: Ilja Sidoroff @ 2014-09-08 14:37 UTC (permalink / raw)
To: greg; +Cc: linux-kernel, Ilja Sidoroff
This patch removes redundant goto or break statements in hfa384x_usb.c as found by checkpatch.pl
Signed-off-by: Ilja Sidoroff <ilja.sidoroff@iki.fi>
---
Changes in v2:
* replaced goto with break and so got rid of a label
drivers/staging/wlan-ng/hfa384x_usb.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c
index 2f63e0c..cac55c6 100644
--- a/drivers/staging/wlan-ng/hfa384x_usb.c
+++ b/drivers/staging/wlan-ng/hfa384x_usb.c
@@ -3474,7 +3474,7 @@ static void hfa384x_usbin_rx(wlandevice_t *wlandev, struct sk_buff *skb)
/* If exclude and we receive an unencrypted, drop it */
if ((wlandev->hostwep & HOSTWEP_EXCLUDEUNENCRYPTED) &&
!WLAN_GET_FC_ISWEP(fc)) {
- goto done;
+ break;
}
data_len = le16_to_cpu(usbin->rxfrm.desc.data_len);
@@ -3528,11 +3528,9 @@ static void hfa384x_usbin_rx(wlandevice_t *wlandev, struct sk_buff *skb)
netdev_warn(hw->wlandev->netdev, "Received frame on unsupported port=%d\n",
HFA384x_RXSTATUS_MACPORT_GET(
usbin->rxfrm.desc.status));
- goto done;
break;
}
-done:
return;
}
@@ -4127,7 +4125,6 @@ static int hfa384x_isgood_pdrcode(u16 pdrcode)
case HFA384x_PDR_HFA3861_MANF_TESTI:
/* code is OK */
return 1;
- break;
default:
if (pdrcode < 0x1000) {
/* code is OK, but we don't know exactly what it is */
@@ -4140,7 +4137,6 @@ static int hfa384x_isgood_pdrcode(u16 pdrcode)
pdrcode);
return 0;
}
- break;
}
return 0; /* avoid compiler warnings */
}
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-09-08 14:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-08 12:48 [PATCH] Staging: wlan-ng: Remove redundant break/goto statements in hfa384x_usb.c Ilja Sidoroff
2014-09-08 13:47 ` Joe Perches
2014-09-08 14:37 ` [PATCH v2] " Ilja Sidoroff
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox