Skip to contentSkip to conversation

Staging: netlogic: Compress return logic into one line

PATCH New Mihaela Muraru 1 participant 1 message Oct 13, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Staging: netlogic: Compress return logic into one line

Simplify function returns by merging assignment and return into one command line.
Found with Coccinelle
@@
expression e, ret;
@@

-ret =
+return

        e;

-return ret;

---
Changes in v2:
- delete unnecessary braces

---
 drivers/staging/netlogic/xlr_net.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/staging/netlogic/xlr_net.c +2 -4
index 552a7dc..7fa1a61 100644
@@ -1005,10 +1005,8 @@ static int xlr_net_probe(struct platform_device *pdev)
 	 */
 	adapter = (struct xlr_adapter *)
 		devm_kzalloc(&pdev->dev, sizeof(*adapter), GFP_KERNEL);
-	if (!adapter) {
-		err = -ENOMEM;
-		return err;
-	}
+	if (!adapter)
+		return -ENOMEM;
 
 	/*
 	 * XLR and XLS have 1 and 2 NAE controller respectively
Signature · 1 line
2.7.4