diff mbox

[08/15] net: wireless: simplify return flow for usb_control_msg

Message ID 1445439337-19055-9-git-send-email-punitvara@gmail.com
State Awaiting Upstream, archived
Delegated to: David Miller
Headers show

Commit Message

Punit Vara Oct. 21, 2015, 2:55 p.m. UTC
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 | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Punit Vara Oct. 21, 2015, 6:05 p.m. UTC | #1
On Wed, Oct 21, 2015 at 8:30 PM, Jiri Slaby <jslaby@suse.cz> wrote:
> On 10/21/2015, 04:55 PM, Punit Vara wrote:
>> @@ -544,13 +544,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;
>
> ret is now unused, right?
>
> --
> js
> suse labs
Oppp..Sorry I have missed int ret to remove . I will resend the
updated patch soon
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/wireless/at76c50x-usb.c b/drivers/net/wireless/at76c50x-usb.c
index dab2513..09427f6 100644
--- a/drivers/net/wireless/at76c50x-usb.c
+++ b/drivers/net/wireless/at76c50x-usb.c
@@ -544,13 +544,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)