lkml.org 
[lkml]   [2022]   [Dec]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH linux-next] lib: Dhrystone: initialize ret value
Date
Initialize ret value whenever 'if' condition is false in dhry_run_set.

Signed-off-by: Zhouyi Zhou <zhouzhouyi@gmail.com>
---
Dear Developers:
When I invoke make bzImage LLVM=1, clang complains followings:
lib/dhry_run.c:61:6: error: variable 'ret' is used uninitialized whenever 'if' condition is false

Fix above complain by initialize the ret value.

Thanks
Zhouyi
--
lib/dhry_run.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/lib/dhry_run.c b/lib/dhry_run.c
index 31a1d442e4a0..be86e5126c29 100644
--- a/lib/dhry_run.c
+++ b/lib/dhry_run.c
@@ -64,6 +64,7 @@ static int dhry_run_set(const char *val, const struct kernel_param *kp)
return ret;
} else {
dhry_run = true;
+ ret = 0;
}

if (dhry_run && system_state == SYSTEM_RUNNING)
--
2.34.1
\
 
 \ /
  Last update: 2023-03-26 23:19    [W:1.360 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site