Skip to contentSkip to conversation

of: property: Remove unneeded return variable

PATCH Applied Yang Li 2 participants 2 messages Mar 2, 2021 – Mar 8, 2021 Device tree

lore
Share & tools
lore

Yang Li

author
#0 lore raw

PATCH 1/1 of: property: Remove unneeded return variable

This patch removes unneeded return variables, using only '0' instead.
It fixes the following warning detected by coccinelle:
./drivers/of/property.c:1371:5-8: Unneeded variable: "ret". Return "0" on line 1388

---
 drivers/of/property.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/of/property.c +1 -2
index 5036a36..2381695 100644
@@ -1368,7 +1368,6 @@ static int of_link_property(struct device_node *con_np, const char *prop_name)
 	const struct supplier_bindings *s = of_supplier_bindings;
 	unsigned int i = 0;
 	bool matched = false;
-	int ret = 0;
 
 	/* Do not stop at first failed link, link all available suppliers. */
 	while (!matched && s->parse_prop) {
@@ -1385,7 +1384,7 @@ static int of_link_property(struct device_node *con_np, const char *prop_name)
 		}
 		s++;
 	}
-	return ret;
+	return 0;
 }
 
 static int of_fwnode_add_links(struct fwnode_handle *fwnode)
Signature · 1 line
1.8.3.1
maintainer Applied
#1 lore raw
Quoted 6 lines · Yang Li

This patch removes unneeded return variables, using only '0' instead.
It fixes the following warning detected by coccinelle:
./drivers/of/property.c:1371:5-8: Unneeded variable: "ret". Return "0" on line 1388

Quoted 6 lines
---
 drivers/of/property.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Applied, thanks!