lkml.org 
[lkml]   [2021]   [Nov]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] fpga: stratix10-soc: Do not use ret uninitialized in s10_probe()
Date
Clang warns:

drivers/fpga/stratix10-soc.c:431:9: warning: variable 'ret' is uninitialized when used here [-Wuninitialized]
return ret;
^~~
drivers/fpga/stratix10-soc.c:402:9: note: initialize the variable 'ret' to silence this warning
int ret;
^
= 0
1 warning generated.

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")
Link: https://github.com/ClangBuiltLinux/linux/issues/1517
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
drivers/fpga/stratix10-soc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/fpga/stratix10-soc.c b/drivers/fpga/stratix10-soc.c
index 737d14c6e0de..357cea58ec98 100644
--- a/drivers/fpga/stratix10-soc.c
+++ b/drivers/fpga/stratix10-soc.c
@@ -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
--
2.34.1

\
 
 \ /
  Last update: 2021-11-29 17:13    [W:0.038 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site