Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1683904 > unrolled thread

[PATCH] usb: gadget: configfs: compress return logic into one line

Started by"Gustavo A. R. Silva" <garsilva@embeddedor.com>
First post2017-07-10 04:30 +0200
Last post2017-07-10 04:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] usb: gadget: configfs: compress return logic into one line "Gustavo A. R. Silva" <garsilva@embeddedor.com> - 2017-07-10 04:30 +0200

#1683904 — [PATCH] usb: gadget: configfs: compress return logic into one line

From"Gustavo A. R. Silva" <garsilva@embeddedor.com>
Date2017-07-10 04:30 +0200
Subject[PATCH] usb: gadget: configfs: compress return logic into one line
Message-ID<u1wCt-7v9-7@gated-at.bofh.it>
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/configfs.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c
index a22a892..00b4454 100644
--- a/drivers/usb/gadget/configfs.c
+++ b/drivers/usb/gadget/configfs.c
@@ -1502,12 +1502,9 @@ EXPORT_SYMBOL_GPL(unregister_gadget_item);
 
 static int __init gadget_cfs_init(void)
 {
-	int ret;
-
 	config_group_init(&gadget_subsys.su_group);
 
-	ret = configfs_register_subsystem(&gadget_subsys);
-	return ret;
+	return configfs_register_subsystem(&gadget_subsys);
 }
 module_init(gadget_cfs_init);
 
-- 
2.5.0

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web