All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH linux-next] lib: Dhrystone: initialize ret value
@ 2022-12-24  5:06 Zhouyi Zhou
  2022-12-24  5:58 ` Nathan Chancellor
  0 siblings, 1 reply; 3+ messages in thread
From: Zhouyi Zhou @ 2022-12-24  5:06 UTC (permalink / raw)
  To: nathan, ndesaulniers, trix, akpm, geert+renesas, linux-kernel, llvm
  Cc: Zhouyi Zhou

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH linux-next] lib: Dhrystone: initialize ret value
  2022-12-24  5:06 [PATCH linux-next] lib: Dhrystone: initialize ret value Zhouyi Zhou
@ 2022-12-24  5:58 ` Nathan Chancellor
  2022-12-24  6:19   ` Zhouyi Zhou
  0 siblings, 1 reply; 3+ messages in thread
From: Nathan Chancellor @ 2022-12-24  5:58 UTC (permalink / raw)
  To: Zhouyi Zhou; +Cc: ndesaulniers, trix, akpm, geert+renesas, linux-kernel, llvm

On Sat, Dec 24, 2022 at 01:06:40PM +0800, Zhouyi Zhou wrote:
> 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

Thank you for the patch! I think this has already been fixed:

https://lore.kernel.org/20221219221045.0ABAEC433D2@smtp.kernel.org/

-next is on a break so it won't be there for a bit:

https://lore.kernel.org/20221220112148.64f183ce@canb.auug.org.au/

Cheers,
Nathan

> --
>  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
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH linux-next] lib: Dhrystone: initialize ret value
  2022-12-24  5:58 ` Nathan Chancellor
@ 2022-12-24  6:19   ` Zhouyi Zhou
  0 siblings, 0 replies; 3+ messages in thread
From: Zhouyi Zhou @ 2022-12-24  6:19 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: ndesaulniers, trix, akpm, geert+renesas, linux-kernel, llvm

On Sat, Dec 24, 2022 at 1:58 PM Nathan Chancellor <nathan@kernel.org> wrote:
>
> On Sat, Dec 24, 2022 at 01:06:40PM +0800, Zhouyi Zhou wrote:
> > 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
>
> Thank you for the patch! I think this has already been fixed:
>
> https://lore.kernel.org/20221219221045.0ABAEC433D2@smtp.kernel.org/
Thank you for reviewing my patch ;-), I see
>
> -next is on a break so it won't be there for a bit:
>
> https://lore.kernel.org/20221220112148.64f183ce@canb.auug.org.au/
Thank you for your guidance, I think I should stop working on -next
for awhile ;-)
>
> Cheers,
> Nathan
Cheers
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
> >

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-12-24  6:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-24  5:06 [PATCH linux-next] lib: Dhrystone: initialize ret value Zhouyi Zhou
2022-12-24  5:58 ` Nathan Chancellor
2022-12-24  6:19   ` Zhouyi Zhou

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.