* [PATCH] xtensa: no need to initialise statics to 0
@ 2022-05-08 2:29 Jason Wang
2022-05-11 9:09 ` Max Filippov
0 siblings, 1 reply; 2+ messages in thread
From: Jason Wang @ 2022-05-08 2:29 UTC (permalink / raw)
To: jcmvbkbc; +Cc: chris, wangborong, linux-xtensa, linux-kernel
Static variables do not need to be initialised to 0, because compiler
will initialise all uninitialised statics to 0. Thus, remove the
unneeded initializations.
Signed-off-by: Jason Wang <wangborong@cdjrlc.com>
---
arch/xtensa/platforms/xt2000/setup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/xtensa/platforms/xt2000/setup.c b/arch/xtensa/platforms/xt2000/setup.c
index 145d129be76f..0dc22c371614 100644
--- a/arch/xtensa/platforms/xt2000/setup.c
+++ b/arch/xtensa/platforms/xt2000/setup.c
@@ -78,7 +78,7 @@ void __init platform_init(bp_tag_t *first)
void platform_heartbeat(void)
{
- static int i=0, t = 0;
+ static int i, t;
if (--t < 0)
{
--
2.35.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] xtensa: no need to initialise statics to 0
2022-05-08 2:29 [PATCH] xtensa: no need to initialise statics to 0 Jason Wang
@ 2022-05-11 9:09 ` Max Filippov
0 siblings, 0 replies; 2+ messages in thread
From: Max Filippov @ 2022-05-11 9:09 UTC (permalink / raw)
To: Jason Wang; +Cc: Chris Zankel, open list:TENSILICA XTENSA PORT (xtensa), LKML
On Sat, May 7, 2022 at 7:30 PM Jason Wang <wangborong@cdjrlc.com> wrote:
>
> Static variables do not need to be initialised to 0, because compiler
> will initialise all uninitialised statics to 0. Thus, remove the
> unneeded initializations.
>
> Signed-off-by: Jason Wang <wangborong@cdjrlc.com>
> ---
> arch/xtensa/platforms/xt2000/setup.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Thanks, applied to my xtensa tree.
-- Max
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-05-11 9:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-08 2:29 [PATCH] xtensa: no need to initialise statics to 0 Jason Wang
2022-05-11 9:09 ` Max Filippov
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.