linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk: clk.c: Fixed statics initialized to 0
@ 2021-03-13  3:41 Pallavi Prabhu
  2021-03-13 21:06 ` Stephen Boyd
  0 siblings, 1 reply; 3+ messages in thread
From: Pallavi Prabhu @ 2021-03-13  3:41 UTC (permalink / raw)
  To: mturquette, sboyd, linux-clk, linux-kernel

Uninitialized static variable from 0, as statics get auto-initialized to 0 during execution.
Signed-off-by: Pallavi Prabhu <rpallaviprabhu@gmail.com>
---
 drivers/clk/clk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 5052541a0986..763ad2c960bd 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -2931,7 +2931,7 @@ EXPORT_SYMBOL_GPL(clk_is_match);
 #include <linux/debugfs.h>
 
 static struct dentry *rootdir;
-static int inited = 0;
+static int inited;
 static DEFINE_MUTEX(clk_debug_lock);
 static HLIST_HEAD(clk_debug_list);
 
-- 
2.25.1


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

* Re: [PATCH] clk: clk.c: Fixed statics initialized to 0
  2021-03-13  3:41 [PATCH] clk: clk.c: Fixed statics initialized to 0 Pallavi Prabhu
@ 2021-03-13 21:06 ` Stephen Boyd
  2021-03-14  6:21   ` Pallavi Prabhu
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Boyd @ 2021-03-13 21:06 UTC (permalink / raw)
  To: Pallavi Prabhu, linux-clk, linux-kernel, mturquette

Quoting Pallavi Prabhu (2021-03-12 19:41:12)
> Uninitialized static variable from 0, as statics get auto-initialized to 0 during execution.
> Signed-off-by: Pallavi Prabhu <rpallaviprabhu@gmail.com>

Need a newline between signed-off-by line and commit text. Also please
wrap the commit text at 80 or 78 characters or so.

> ---
>  drivers/clk/clk.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> index 5052541a0986..763ad2c960bd 100644
> --- a/drivers/clk/clk.c
> +++ b/drivers/clk/clk.c
> @@ -2931,7 +2931,7 @@ EXPORT_SYMBOL_GPL(clk_is_match);
>  #include <linux/debugfs.h>
>  
>  static struct dentry *rootdir;
> -static int inited = 0;
> +static int inited;

I think it's being explicit; although it is the same. Is this noticed by
some static checker or something? I'd like to ignore this patch if
possible.

>  static DEFINE_MUTEX(clk_debug_lock);
>  static HLIST_HEAD(clk_debug_list);
>

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

* Re: [PATCH] clk: clk.c: Fixed statics initialized to 0
  2021-03-13 21:06 ` Stephen Boyd
@ 2021-03-14  6:21   ` Pallavi Prabhu
  0 siblings, 0 replies; 3+ messages in thread
From: Pallavi Prabhu @ 2021-03-14  6:21 UTC (permalink / raw)
  To: Stephen Boyd; +Cc: linux-clk, linux-kernel, Michael Turquette

On Sun, 14 Mar 2021 at 02:36, Stephen Boyd <sboyd@kernel.org> wrote:
>
> Quoting Pallavi Prabhu (2021-03-12 19:41:12)
> > Uninitialized static variable from 0, as statics get auto-initialized to 0 during execution.
> > Signed-off-by: Pallavi Prabhu <rpallaviprabhu@gmail.com>
>
> Need a newline between signed-off-by line and commit text. Also please
> wrap the commit text at 80 or 78 characters or so.
>
> > ---
> >  drivers/clk/clk.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> > index 5052541a0986..763ad2c960bd 100644
> > --- a/drivers/clk/clk.c
> > +++ b/drivers/clk/clk.c
> > @@ -2931,7 +2931,7 @@ EXPORT_SYMBOL_GPL(clk_is_match);
> >  #include <linux/debugfs.h>
> >
> >  static struct dentry *rootdir;
> > -static int inited = 0;
> > +static int inited;
>
> I think it's being explicit; although it is the same. Is this noticed by
> some static checker or something? I'd like to ignore this patch if
> possible.
The Static variable initialized to 0 was noticed by the checkpatch.
This error message was corrected.
Would you want me to send a v2 with the proper commit text?

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

end of thread, other threads:[~2021-03-14  6:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-13  3:41 [PATCH] clk: clk.c: Fixed statics initialized to 0 Pallavi Prabhu
2021-03-13 21:06 ` Stephen Boyd
2021-03-14  6:21   ` Pallavi Prabhu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).