fpga: stratix10-soc: Do not use ret uninitialized in s10_probe()
PATCH v2 1/1 fpga: stratix10-soc: Do not use ret uninitialized in s10_probe()
Clang warns:
drivers/fpga/stratix10-soc.c:431:9: warning: variable 'ret' is uninitialized when used here [-Wuninitialized]
return ret;
^~~ret is only assigned in an error path now so just return 0 directly.
---
v1 -> v2: https://lore.kernel.org/r/[email protected]/
* Drop clang's suggestion text (Tom).
* Pick up Russ and Tom's review tags.
drivers/fpga/stratix10-soc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/fpga/stratix10-soc.c +1 -1
@@ -428,7 +428,7 @@ static int s10_probe(struct platform_device *pdev) }platform_set_drvdata (pdev, mgr); -return ret; +return 0 ; probe_err:stratix10_svc_free_channel (priv->chan);
base-commit: 8886a579744fbfa53e69aa453ed10ae3b1f9abac
Signature · 1 line
2.34.1
Quoted 6 lines · Nathan Chancellor
Clang warns:
drivers/fpga/stratix10-soc.c:431:9: warning: variable 'ret' is uninitialized when used here [-Wuninitialized]return ret; ^~~
Quoted 7 lines
ret is only assigned in an error path now so just return 0 directly.
Fixes 4ba0b2c294fe ("fpga: mgr: Use standard dev_release for class driver")Reviewed-by Russ Weight <[email protected]>Reviewed-by Tom Rix <[email protected]>Signed-off-by Nathan Chancellor <[email protected]>
Thanks,
Yilun
Quoted 28 lines
---
v1 -> v2: https://lore.kernel.org/r/[email protected]/
* Drop clang's suggestion text (Tom).
* Pick up Russ and Tom's review tags.
drivers/fpga/stratix10-soc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/fpga/stratix10-soc.c +1
-1@@ -428,7 +428,7 @@ static int s10_probe(struct platform_device *pdev) }platform_set_drvdata (pdev, mgr); -return ret; +return 0 ; probe_err:stratix10_svc_free_channel (priv->chan);base-commit:
8886a579744fbfa53e69aa453ed10ae3b1f9abacSignature · 1 line
2.34.1
Quoted 38 lines · Nathan Chancellor
Clang warns:
drivers/fpga/stratix10-soc.c:431:9: warning: variable 'ret' is uninitialized when used here [-Wuninitialized]return ret; ^~~ret is only assigned in an error path now so just return 0 directly.
Fixes 4ba0b2c294fe ("fpga: mgr: Use standard dev_release for class driver")Reviewed-by Russ Weight <[email protected]>Reviewed-by Tom Rix <[email protected]>Signed-off-by Nathan Chancellor <[email protected]>---
v1 -> v2: https://lore.kernel.org/r/[email protected]/
* Drop clang's suggestion text (Tom).
* Pick up Russ and Tom's review tags.
drivers/fpga/stratix10-soc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/fpga/stratix10-soc.c +1
-1@@ -428,7 +428,7 @@ static int s10_probe(struct platform_device *pdev) }platform_set_drvdata (pdev, mgr); -return ret; +return 0 ; probe_err:stratix10_svc_free_channel (priv->chan);
Quoted 4 lines
base-commit:
8886a579744fbfa53e69aa453ed10ae3b1f9abacSignature · 1 line
2.34.1
Applied to for-next,
Thanks