diff mbox series

of: property: Remove unneeded return variable

Message ID 1614676598-105267-1-git-send-email-yang.lee@linux.alibaba.com
State Accepted, archived
Headers show
Series of: property: Remove unneeded return variable | expand

Checks

Context Check Description
robh/checkpatch success

Commit Message

Yang Li March 2, 2021, 9:16 a.m. UTC
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

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
 drivers/of/property.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Rob Herring (Arm) March 8, 2021, 6:43 p.m. UTC | #1
On Tue, 02 Mar 2021 17:16:38 +0800, Yang Li wrote:
> 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
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
> ---
>  drivers/of/property.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 

Applied, thanks!
diff mbox series

Patch

diff --git a/drivers/of/property.c b/drivers/of/property.c
index 5036a36..2381695 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -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)