Skip to contentSkip to conversation

clk: clk.c: Fixed statics initialized to 0

PATCH In review Pallavi Prabhu 2 participants 3 messages Mar 13, 2021 – Mar 14, 2021 Common clk

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clk: clk.c: Fixed statics initialized to 0

Uninitialized static variable from 0, as statics get auto-initialized to 0 during execution.

---
 drivers/clk/clk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/clk.c +1 -1
index 5052541a0986..763ad2c960bd 100644
@@ -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);
 
Signature · 1 line
2.25.1
maintainer
#1 lore raw

Quoting Pallavi Prabhu (2021-03-12 19:41:12)

Quoted 2 lines

Uninitialized static variable from 0, as statics get auto-initialized to 0 during execution.

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

Quoted 9 lines
---
 drivers/clk/clk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/clk.c +0 -0
index 5052541a0986..763ad2c960bd 100644

drivers/clk/clk.c EXPORT_SYMBOL_GPL(clk_is_match); · line 2934

Quoted 5 lines
drivers/clk/clk.c +1 -1
@@ -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.

Quoted 3 lines
drivers/clk/clk.c +0 -0
 static DEFINE_MUTEX(clk_debug_lock);
 static HLIST_HEAD(clk_debug_list);
 
#2 lore raw
Quoted 19 lines · Stephen Boyd

Quoting Pallavi Prabhu (2021-03-12 19:41:12)

Quoted 2 lines

Uninitialized static variable from 0, as statics get auto-initialized to 0 during execution.

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

Quoted 11 lines
---
 drivers/clk/clk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/clk.c +0 -0
index 5052541a0986..763ad2c960bd 100644
@@ -2931,7 +2931,7 @@ EXPORT_SYMBOL_GPL(clk_is_match);
 #include <linux/debugfs.h>
 
Quoted 7 lines

drivers/clk/clk.c EXPORT_SYMBOL_GPL(clk_is_match); · line 2934

Quoted 3 lines
drivers/clk/clk.c +1 -1
 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?