Skip to contentSkip to conversation

interconnect: Fix a GCC compiler warning

PATCH In review zhong jiang 3 participants 11 messages Sep 16, 2018 – Sep 17, 2018 Interconnect API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 interconnect: Fix a GCC compiler warning

Fix the following compile warning:

drivers/interconnect/core.c:26:23: warning: ‘icc_debugfs_dir’ defined but not used [-Wunused-variable]
static struct dentry *icc_debugfs_dir;

---
 drivers/interconnect/core.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/interconnect/core.c +3 -0
index 2740f1a..9ea9959 100644
@@ -23,7 +23,10 @@
 static DEFINE_IDR(icc_idr);
 static LIST_HEAD(icc_provider_list);
 static DEFINE_MUTEX(icc_lock);
+
+#ifdef CONFIG_DEBUG_FS
 static struct dentry *icc_debugfs_dir;
+#endif
 
 /**
  * struct icc_req - constraints that are attached to each node
Signature · 1 line
1.7.12.4
#1 lore raw
Quoted 1 line · zhong jiang

Fix the following compile warning:

+to Andrew and Greg

#2 lore raw
Quoted 4 lines · zhong jiang
Quoted 1 line · zhong jiang

Fix the following compile warning:

+to Andrew and Greg

+me for what? Nothing is here :(

#3 lore raw
Quoted 6 lines · Greg KH
Quoted 4 lines · zhong jiang
Quoted 1 line · zhong jiang

Fix the following compile warning:

+to Andrew and Greg

+me for what? Nothing is here :(

The drivers/interconnect/core.c is not updated since 2017. I think the maintainer
is busy with other things. Therefore, I hope that you or Andrew and pick up the
patch. :-) . if you can not do this. I am sorry for disturbing you.

Thanks,
zhong jiang

#4 lore raw
Quoted 10 lines · zhong jiang
Quoted 6 lines · Greg KH
Quoted 4 lines · zhong jiang
Quoted 1 line · zhong jiang

Fix the following compile warning:

+to Andrew and Greg

+me for what? Nothing is here :(

The drivers/interconnect/core.c is not updated since 2017. I think the maintainer
is busy with other things. Therefore, I hope that you or Andrew and pick up the
patch. :-) . if you can not do this. I am sorry for disturbing you.

I can do that, but again, I do not see any patch here in this email at all, sorry.

greg k-h

#5 lore raw
Quoted 5 lines · Greg KH
Quoted 4 lines · zhong jiang
Quoted 3 lines · Greg KH
Quoted 2 lines · zhong jiang
Quoted 1 line · zhong jiang

Fix the following compile warning:

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 2 lines

+to Andrew and Greg

+me for what? Nothing is here :(

The drivers/interconnect/core.c is not updated since 2017. I think the maintainer
is busy with other things. Therefore, I hope that you or Andrew and pick up the
patch. :-) . if you can not do this. I am sorry for disturbing you.

I can do that, but again, I do not see any patch here in this email at all, sorry.

:-[ , I am sorry for handling email mistakely.

Thanks,
zhong jiang

Quoted 1 line

greg k-h

#6 lore raw
In reply to zhong jiang

+to Greg and Andrew.

Quoted 25 lines · zhong jiang

Fix the following compile warning:

drivers/interconnect/core.c:26:23: warning: ‘icc_debugfs_dir’ defined but not used [-Wunused-variable]
static struct dentry *icc_debugfs_dir;

---
 drivers/interconnect/core.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/interconnect/core.c +3 -0
index 2740f1a..9ea9959 100644
@@ -23,7 +23,10 @@
 static DEFINE_IDR(icc_idr);
 static LIST_HEAD(icc_provider_list);
 static DEFINE_MUTEX(icc_lock);
+
+#ifdef CONFIG_DEBUG_FS
 static struct dentry *icc_debugfs_dir;
+#endif
 
 /**
  * struct icc_req - constraints that are attached to each node
#7 lore raw
Quoted 11 lines · zhong jiang

+to Greg and Andrew.

Quoted 8 lines · zhong jiang

Fix the following compile warning:

drivers/interconnect/core.c:26:23: warning: ‘icc_debugfs_dir’ defined but not used [-Wunused-variable]
static struct dentry *icc_debugfs_dir;

---
 drivers/interconnect/core.c | 3 +++

This file is not in a released tree, where are you seeing it?

Quoted 14 lines
Quoted 7 lines
 1 file changed, 3 insertions(+)
drivers/interconnect/core.c +0 -0
index 2740f1a..9ea9959 100644

drivers/interconnect/core.c line 29

Quoted 7 lines
drivers/interconnect/core.c +3 -0
@@ -23,7 +23,10 @@
 static DEFINE_IDR(icc_idr);
 static LIST_HEAD(icc_provider_list);
 static DEFINE_MUTEX(icc_lock);
+
+#ifdef CONFIG_DEBUG_FS
 static struct dentry *icc_debugfs_dir;
+#endif

Why not move the variable to where it is used? It should be able to go under an existing #ifdef section, right?

thanks,

greg k-h

#8 lore raw
Quoted 6 lines · Greg KH
Quoted 5 lines · zhong jiang

+to Greg and Andrew.

Quoted 2 lines · zhong jiang

Fix the following compile warning:

Quoted 7 lines
Quoted 6 lines
Quoted 6 lines

drivers/interconnect/core.c:26:23: warning: 'icc_debugfs_dir' defined but not used [-Wunused-variable]
static struct dentry *icc_debugfs_dir;

---
 drivers/interconnect/core.c | 3 +++

This file is not in a released tree, where are you seeing it?

I see it in linux-next.

Quoted 16 lines
Quoted 14 lines
Quoted 7 lines
 1 file changed, 3 insertions(+)
drivers/interconnect/core.c +0 -0
index 2740f1a..9ea9959 100644

drivers/interconnect/core.c line 29

Quoted 7 lines
drivers/interconnect/core.c +3 -0
@@ -23,7 +23,10 @@
 static DEFINE_IDR(icc_idr);
 static LIST_HEAD(icc_provider_list);
 static DEFINE_MUTEX(icc_lock);
+
+#ifdef CONFIG_DEBUG_FS
 static struct dentry *icc_debugfs_dir;
+#endif

Why not move the variable to where it is used? It should be able to go under an existing #ifdef section, right?

Because the variable need to be used in __init and __exit. So it should be identified as a gloabl variable. I fix it under the #ifdef condition.

Thanks,
zhong jiang

Quoted 6 lines

thanks,

greg k-h

.

#9 lore raw
Quoted 7 lines · zhong jiang
Quoted 6 lines · Greg KH
Quoted 5 lines · zhong jiang

+to Greg and Andrew.

Quoted 2 lines · zhong jiang

Fix the following compile warning:

Quoted 8 lines
Quoted 7 lines
Quoted 6 lines
Quoted 6 lines

drivers/interconnect/core.c:26:23: warning: 'icc_debugfs_dir' defined but not used [-Wunused-variable]
static struct dentry *icc_debugfs_dir;

---
 drivers/interconnect/core.c | 3 +++

This file is not in a released tree, where are you seeing it?

I see it in linux-next.

Then please contact the owner of the branch where it came from. They are the only ones that can handle such a patch, not anyone else.

Quoted 16 lines
Quoted 16 lines
Quoted 14 lines
Quoted 7 lines
 1 file changed, 3 insertions(+)
drivers/interconnect/core.c +0 -0
index 2740f1a..9ea9959 100644

drivers/interconnect/core.c line 29

Quoted 7 lines
drivers/interconnect/core.c +3 -0
@@ -23,7 +23,10 @@
 static DEFINE_IDR(icc_idr);
 static LIST_HEAD(icc_provider_list);
 static DEFINE_MUTEX(icc_lock);
+
+#ifdef CONFIG_DEBUG_FS
 static struct dentry *icc_debugfs_dir;
+#endif

Why not move the variable to where it is used? It should be able to go under an existing #ifdef section, right?

Quoted 2 lines

Because the variable need to be used in __init and __exit. So it should be identified as a gloabl variable. I fix it under the #ifdef condition.

If the variable is being used this way, then the code is written incorrectly, such an #ifdef should not be needed for any debugfs calls/variables.

thanks,

greg k-h

#10 lore raw

Hi Zhong and Greg,

Quoted 8 lines · Greg KH
Quoted 7 lines · zhong jiang
Quoted 6 lines · Greg KH
Quoted 5 lines · zhong jiang

+to Greg and Andrew.

Quoted 2 lines · zhong jiang

Fix the following compile warning:

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Quoted 6 lines
Quoted 6 lines

drivers/interconnect/core.c:26:23: warning: 'icc_debugfs_dir' defined but not used [-Wunused-variable]
static struct dentry *icc_debugfs_dir;

---
 drivers/interconnect/core.c | 3 +++

This file is not in a released tree, where are you seeing it?

I see it in linux-next.

Yes, it has been recently pulled into linux-next for wider testing coverage. Thank you Zhong for reporting this.

Quoted 20 lines

Then please contact the owner of the branch where it came from. They are the only ones that can handle such a patch, not anyone else.

Quoted 16 lines
Quoted 16 lines
Quoted 14 lines
Quoted 7 lines
 1 file changed, 3 insertions(+)
drivers/interconnect/core.c +0 -0
index 2740f1a..9ea9959 100644

drivers/interconnect/core.c line 29

Quoted 7 lines
drivers/interconnect/core.c +3 -0
@@ -23,7 +23,10 @@
 static DEFINE_IDR(icc_idr);
 static LIST_HEAD(icc_provider_list);
 static DEFINE_MUTEX(icc_lock);
+
+#ifdef CONFIG_DEBUG_FS
 static struct dentry *icc_debugfs_dir;
+#endif

Why not move the variable to where it is used? It should be able to go under an existing #ifdef section, right?

Quoted 6 lines
Quoted 2 lines

Because the variable need to be used in __init and __exit. So it should be identified as a gloabl variable. I fix it under the #ifdef condition.

If the variable is being used this way, then the code is written incorrectly, such an #ifdef should not be needed for any debugfs calls/variables.

Thanks for the comments. Will improve it.

BR,
Georgi