lkml.org 
[lkml]   [2017]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] usb: gadget: legacy: ncm: compress return logic into one line
Simplify return logic to avoid unnecessary variable assignment.

This issue was detected using Coccinelle and the following
semantic patch:

@@
local idexpression ret;
expression e;
@@

-ret =
+return
e;
-return ret;

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
drivers/usb/gadget/legacy/ncm.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/gadget/legacy/ncm.c b/drivers/usb/gadget/legacy/ncm.c
index 0aba682..cb0d84f 100644
--- a/drivers/usb/gadget/legacy/ncm.c
+++ b/drivers/usb/gadget/legacy/ncm.c
@@ -106,10 +106,8 @@ static int ncm_do_config(struct usb_configuration *c)
}

f_ncm = usb_get_function(f_ncm_inst);
- if (IS_ERR(f_ncm)) {
- status = PTR_ERR(f_ncm);
- return status;
- }
+ if (IS_ERR(f_ncm))
+ return PTR_ERR(f_ncm);

status = usb_add_function(c, f_ncm);
if (status < 0) {
--
2.5.0
\
 
 \ /
  Last update: 2017-07-10 04:57    [W:0.027 / U:0.720 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site