Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: gadget: compress return logic into one line

Simplify return logic and avoid unnecessary variable assignment.

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Gustavo A. R. Silva and committed by
Greg Kroah-Hartman
0cb5818a 5468099c

+2 -4
+2 -4
drivers/usb/gadget/legacy/ncm.c
··· 102 102 } 103 103 104 104 f_ncm = usb_get_function(f_ncm_inst); 105 - if (IS_ERR(f_ncm)) { 106 - status = PTR_ERR(f_ncm); 107 - return status; 108 - } 105 + if (IS_ERR(f_ncm)) 106 + return PTR_ERR(f_ncm); 109 107 110 108 status = usb_add_function(c, f_ncm); 111 109 if (status < 0) {