Skip to content

Commit

Permalink
of: property: Remove unneeded return variable
Browse files Browse the repository at this point in the history
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>
Link: https://lore.kernel.org/r/1614676598-105267-1-git-send-email-yang.lee@linux.alibaba.com
Signed-off-by: Rob Herring <robh@kernel.org>
  • Loading branch information
Yang Li authored and Rob Herring committed Mar 11, 2021
1 parent 886db32 commit 065cac6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/of/property.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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)
Expand Down

0 comments on commit 065cac6

Please sign in to comment.