* usb: gadget: compress return logic into one line
@ 2018-01-18 22:25 ` Gustavo A. R. Silva
0 siblings, 0 replies; 2+ messages in thread
From: Gustavo A. R. Silva @ 2018-01-18 22:25 UTC (permalink / raw)
To: Felipe Balbi, Greg Kroah-Hartman
Cc: linux-usb, linux-kernel, Gustavo A. R. Silva
Simplify return logic and avoid unnecessary variable assignment.
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 fcee1ee0..8465f08 100644
--- a/drivers/usb/gadget/legacy/ncm.c
+++ b/drivers/usb/gadget/legacy/ncm.c
@@ -102,10 +102,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) {
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] usb: gadget: compress return logic into one line
@ 2018-01-18 22:25 ` Gustavo A. R. Silva
0 siblings, 0 replies; 2+ messages in thread
From: Gustavo A. R. Silva @ 2018-01-18 22:25 UTC (permalink / raw)
To: Felipe Balbi, Greg Kroah-Hartman
Cc: linux-usb, linux-kernel, Gustavo A. R. Silva
Simplify return logic and avoid unnecessary variable assignment.
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 fcee1ee0..8465f08 100644
--- a/drivers/usb/gadget/legacy/ncm.c
+++ b/drivers/usb/gadget/legacy/ncm.c
@@ -102,10 +102,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.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-01-18 22:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-18 22:25 usb: gadget: compress return logic into one line Gustavo A. R. Silva
2018-01-18 22:25 ` [PATCH] " Gustavo A. R. Silva
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.