Skip to contentSkip to conversation

staging: greybus: arche-platform: compress return logic into one line

PATCH New Eva Rachel Retuya 1 participant 1 message Sep 21, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: greybus: arche-platform: compress return logic into one line

Modify return statement to use the value being returned directly instead of assigning it first to 'ret' and returning this variable. Coccinelle semantic patch used:

@@
expression e;
local idexpression ret;
@@

-ret =
+return

	e;

-return ret;

---
 drivers/staging/greybus/arche-platform.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/greybus/arche-platform.c +1 -2
index 9d9048e..d6b3609 100644
@@ -634,8 +634,7 @@ static int arche_platform_probe(struct platform_device *pdev)
 	arche_pdata->wake_detect_gpio = of_get_named_gpio(np, "svc,wake-detect-gpio", 0);
 	if (arche_pdata->wake_detect_gpio < 0) {
 		dev_err(dev, "failed to get wake detect gpio\n");
-		ret = arche_pdata->wake_detect_gpio;
-		return ret;
+		return arche_pdata->wake_detect_gpio;
 	}
 
 	ret = devm_gpio_request(dev, arche_pdata->wake_detect_gpio, "wake detect");
Signature · 1 line
2.7.4