linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 05/15] net: wireless: ti: Return flow can be simplified for wl1271_cmd_interrogate
@ 2015-10-21 19:07 Punit Vara
  2015-10-21 19:07 ` [PATCH v2 08/15] net: wireless: simplify return flow for usb_control_msg Punit Vara
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Punit Vara @ 2015-10-21 19:07 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless, netdev, linux-kernel, jslaby, lkp, Punit Vara

Remove int ret suggested by kbuild test robot

This patch is to the wlcore/acx.c file that fixes up warning
reported by coccicheck:

WARNING: end returns can be simplified if negative or 0 value

Prefer direct return value instead of writing 2-3 more sentence.

Signed-off-by: Punit Vara <punitvara@gmail.com>
---
 drivers/net/wireless/ti/wlcore/acx.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/net/wireless/ti/wlcore/acx.c b/drivers/net/wireless/ti/wlcore/acx.c
index f28fa3b..6b566d9 100644
--- a/drivers/net/wireless/ti/wlcore/acx.c
+++ b/drivers/net/wireless/ti/wlcore/acx.c
@@ -158,16 +158,11 @@ out:
 int wl1271_acx_mem_map(struct wl1271 *wl, struct acx_header *mem_map,
 		       size_t len)
 {
-	int ret;
 
 	wl1271_debug(DEBUG_ACX, "acx mem map");
 
-	ret = wl1271_cmd_interrogate(wl, ACX_MEM_MAP, mem_map,
+	return wl1271_cmd_interrogate(wl, ACX_MEM_MAP, mem_map,
 				     sizeof(struct acx_header), len);
-	if (ret < 0)
-		return ret;
-
-	return 0;
 }
 
 int wl1271_acx_rx_msdu_life_time(struct wl1271 *wl)
-- 
2.5.3


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

* [PATCH v2 08/15] net: wireless: simplify return flow for usb_control_msg
  2015-10-21 19:07 [PATCH v2 05/15] net: wireless: ti: Return flow can be simplified for wl1271_cmd_interrogate Punit Vara
@ 2015-10-21 19:07 ` Punit Vara
  2015-10-21 22:00 ` [PATCH v2 05/15] net: wireless: ti: Return flow can be simplified for wl1271_cmd_interrogate Sergei Shtylyov
  2015-10-22  6:54 ` Eliad Peller
  2 siblings, 0 replies; 4+ messages in thread
From: Punit Vara @ 2015-10-21 19:07 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless, netdev, linux-kernel, jslaby, lkp, Punit Vara

remove int ret suggested by Jiri Slaby
This patch is to the at76c50x-usb.c file that fixes up warning
reported by coccicheck:

WARNING: end returns can be simplified if negative or 0 value

Prefer direct return value instead of writing 2-3 more sentence.

Signed-off-by: Punit Vara <punitvara@gmail.com>
---
 drivers/net/wireless/at76c50x-usb.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/net/wireless/at76c50x-usb.c b/drivers/net/wireless/at76c50x-usb.c
index dab2513..b4aa062 100644
--- a/drivers/net/wireless/at76c50x-usb.c
+++ b/drivers/net/wireless/at76c50x-usb.c
@@ -543,14 +543,10 @@ static void at76_ledtrig_tx_activity(void)
 
 static int at76_remap(struct usb_device *udev)
 {
-	int ret;
-	ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x0a,
+	return usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x0a,
 			      USB_TYPE_VENDOR | USB_DIR_OUT |
 			      USB_RECIP_INTERFACE, 0, 0, NULL, 0,
 			      USB_CTRL_GET_TIMEOUT);
-	if (ret < 0)
-		return ret;
-	return 0;
 }
 
 static int at76_get_op_mode(struct usb_device *udev)
-- 
2.5.3


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

* Re: [PATCH v2 05/15] net: wireless: ti: Return flow can be simplified for wl1271_cmd_interrogate
  2015-10-21 19:07 [PATCH v2 05/15] net: wireless: ti: Return flow can be simplified for wl1271_cmd_interrogate Punit Vara
  2015-10-21 19:07 ` [PATCH v2 08/15] net: wireless: simplify return flow for usb_control_msg Punit Vara
@ 2015-10-21 22:00 ` Sergei Shtylyov
  2015-10-22  6:54 ` Eliad Peller
  2 siblings, 0 replies; 4+ messages in thread
From: Sergei Shtylyov @ 2015-10-21 22:00 UTC (permalink / raw)
  To: Punit Vara, kvalo; +Cc: linux-wireless, netdev, linux-kernel, jslaby, lkp

On 10/21/2015 10:07 PM, Punit Vara wrote:

> Remove int ret suggested by kbuild test robot
>
> This patch is to the wlcore/acx.c file that fixes up warning
> reported by coccicheck:
>
> WARNING: end returns can be simplified if negative or 0 value
>
> Prefer direct return value instead of writing 2-3 more sentence.
>
> Signed-off-by: Punit Vara <punitvara@gmail.com>
> ---
>   drivers/net/wireless/ti/wlcore/acx.c | 7 +------
>   1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/net/wireless/ti/wlcore/acx.c b/drivers/net/wireless/ti/wlcore/acx.c
> index f28fa3b..6b566d9 100644
> --- a/drivers/net/wireless/ti/wlcore/acx.c
> +++ b/drivers/net/wireless/ti/wlcore/acx.c
> @@ -158,16 +158,11 @@ out:
>   int wl1271_acx_mem_map(struct wl1271 *wl, struct acx_header *mem_map,
>   		       size_t len)
>   {
> -	int ret;
>

    You now need to kill this empty line as well.

[...]

MBR, Sergei+


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

* Re: [PATCH v2 05/15] net: wireless: ti: Return flow can be simplified for wl1271_cmd_interrogate
  2015-10-21 19:07 [PATCH v2 05/15] net: wireless: ti: Return flow can be simplified for wl1271_cmd_interrogate Punit Vara
  2015-10-21 19:07 ` [PATCH v2 08/15] net: wireless: simplify return flow for usb_control_msg Punit Vara
  2015-10-21 22:00 ` [PATCH v2 05/15] net: wireless: ti: Return flow can be simplified for wl1271_cmd_interrogate Sergei Shtylyov
@ 2015-10-22  6:54 ` Eliad Peller
  2 siblings, 0 replies; 4+ messages in thread
From: Eliad Peller @ 2015-10-22  6:54 UTC (permalink / raw)
  To: Punit Vara
  Cc: Kalle Valo, linux-wireless, open list:NETWORKING DRIVERS, LKML,
	jslaby, lkp

On Wed, Oct 21, 2015 at 10:07 PM, Punit Vara <punitvara@gmail.com> wrote:
> Remove int ret suggested by kbuild test robot
>
> This patch is to the wlcore/acx.c file that fixes up warning
> reported by coccicheck:
>
> WARNING: end returns can be simplified if negative or 0 value
>
> Prefer direct return value instead of writing 2-3 more sentence.
>
> Signed-off-by: Punit Vara <punitvara@gmail.com>
> ---
>  drivers/net/wireless/ti/wlcore/acx.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/net/wireless/ti/wlcore/acx.c b/drivers/net/wireless/ti/wlcore/acx.c
> index f28fa3b..6b566d9 100644
> --- a/drivers/net/wireless/ti/wlcore/acx.c
> +++ b/drivers/net/wireless/ti/wlcore/acx.c
> @@ -158,16 +158,11 @@ out:
>  int wl1271_acx_mem_map(struct wl1271 *wl, struct acx_header *mem_map,
>                        size_t len)
>  {
> -       int ret;
>
>         wl1271_debug(DEBUG_ACX, "acx mem map");
>
> -       ret = wl1271_cmd_interrogate(wl, ACX_MEM_MAP, mem_map,
> +       return wl1271_cmd_interrogate(wl, ACX_MEM_MAP, mem_map,
>                                      sizeof(struct acx_header), len);
> -       if (ret < 0)
> -               return ret;
> -
> -       return 0;
>  }
>
this changes the return value in case of positive values.
have you verified it can't happen / won't affect the code flow?
i'm not sure you really want to blindly patch it...

Eliad.

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

end of thread, other threads:[~2015-10-22  6:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-21 19:07 [PATCH v2 05/15] net: wireless: ti: Return flow can be simplified for wl1271_cmd_interrogate Punit Vara
2015-10-21 19:07 ` [PATCH v2 08/15] net: wireless: simplify return flow for usb_control_msg Punit Vara
2015-10-21 22:00 ` [PATCH v2 05/15] net: wireless: ti: Return flow can be simplified for wl1271_cmd_interrogate Sergei Shtylyov
2015-10-22  6:54 ` Eliad Peller

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).