Re: [PATCH RESEND] staging: wlan-ng: prism2mgmt.c Fix break not useful

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2014-08-11 at 18:15:58 +0200, Jeshwanth Kumar N K <jeshkumar555@xxxxxxxxx> wrote:
> Fixes up warning, break is not useful after a goto or return statement
> 
> Signed-off-by: Jeshwanth Kumar N K <jeshkumar555@xxxxxxxxx>
> ---
>  drivers/staging/wlan-ng/prism2mgmt.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/staging/wlan-ng/prism2mgmt.c b/drivers/staging/wlan-ng/prism2mgmt.c
> index e6a82d3..5837b0e 100644
> --- a/drivers/staging/wlan-ng/prism2mgmt.c
> +++ b/drivers/staging/wlan-ng/prism2mgmt.c
> @@ -1168,7 +1168,6 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
>  		msg->resultcode.data = P80211ENUM_resultcode_success;
>  		result = 0;
>  		goto exit;
> -		break;

Better yet, just return 0 directly here instead of the goto, using a
goto just to return makes no sense.

>  	case P80211ENUM_truth_true:
>  		/* Disable the port (if enabled), only check Port 0 */
>  		if (hw->port_enabled[0]) {
> @@ -1315,12 +1314,10 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
>  		msg->resultcode.data = P80211ENUM_resultcode_success;
>  		result = 0;
>  		goto exit;
> -		break;

Same here.

>  	default:
>  		msg->resultcode.data = P80211ENUM_resultcode_invalid_parameters;
>  		result = 0;
>  		goto exit;
> -		break;

Here as well. With the above three users of the 'exit' label, you could
remove it as well.

Cheers
Tobias
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux