mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/1] clk: Fix build warnings
@ 2014-06-30  9:40 Sachin Kamat
  2014-06-30 13:37 ` Peter De Schrijver
  0 siblings, 1 reply; 3+ messages in thread
From: Sachin Kamat @ 2014-06-30  9:40 UTC (permalink / raw)
  To: linux-kernel; +Cc: mturquette, spk.linux, Peter De Schrijver

‘all_lists’ and ‘orphan_list’ is accessed only when DEBUG_FS is defined.
Thus, make their compilation conditional to fix the below warnings introduced
by commit 27b8d5f723 ("clk: flatten clk tree in debugfs"):
drivers/clk/clk.c:40:27: warning: ‘all_lists’ defined but not used [-Wunused-variable]
drivers/clk/clk.c:46:27: warning: ‘orphan_list’ defined but not used [-Wunused-variable]

Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
Cc: Peter De Schrijver <pdeschrijver@nvidia.com>
---
 drivers/clk/clk.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 7dfb2f308b35..a95233c14f86 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -36,6 +36,7 @@ static HLIST_HEAD(clk_root_list);
 static HLIST_HEAD(clk_orphan_list);
 static LIST_HEAD(clk_notifier_list);
 
+#ifdef CONFIG_DEBUG_FS
 static struct hlist_head *all_lists[] = {
 	&clk_root_list,
 	&clk_orphan_list,
@@ -46,6 +47,7 @@ static struct hlist_head *orphan_list[] = {
 	&clk_orphan_list,
 	NULL,
 };
+#endif
 
 /***           locking             ***/
 static void clk_prepare_lock(void)
-- 
1.7.9.5


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

* Re: [PATCH 1/1] clk: Fix build warnings
  2014-06-30  9:40 [PATCH 1/1] clk: Fix build warnings Sachin Kamat
@ 2014-06-30 13:37 ` Peter De Schrijver
  2014-07-01  6:28   ` Sachin Kamat
  0 siblings, 1 reply; 3+ messages in thread
From: Peter De Schrijver @ 2014-06-30 13:37 UTC (permalink / raw)
  To: Sachin Kamat; +Cc: linux-kernel, mturquette, spk.linux

On Mon, Jun 30, 2014 at 11:40:54AM +0200, Sachin Kamat wrote:
> ‘all_lists’ and ‘orphan_list’ is accessed only when DEBUG_FS is defined.
> Thus, make their compilation conditional to fix the below warnings introduced
> by commit 27b8d5f723 ("clk: flatten clk tree in debugfs"):
> drivers/clk/clk.c:40:27: warning: ‘all_lists’ defined but not used [-Wunused-variable]
> drivers/clk/clk.c:46:27: warning: ‘orphan_list’ defined but not used [-Wunused-variable]
> 

Maybe just move them inside the existing #ifdef CONFIG_DEBUG_FS / #endif?

Like:

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 7dfb2f3..3b735de 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -36,17 +36,6 @@ static HLIST_HEAD(clk_root_list);
 static HLIST_HEAD(clk_orphan_list);
 static LIST_HEAD(clk_notifier_list);
 
-static struct hlist_head *all_lists[] = {
-	&clk_root_list,
-	&clk_orphan_list,
-	NULL,
-};
-
-static struct hlist_head *orphan_list[] = {
-	&clk_orphan_list,
-	NULL,
-};
-
 /***           locking             ***/
 static void clk_prepare_lock(void)
 {
@@ -108,6 +97,17 @@ static void clk_enable_unlock(unsigned long flags)
 #ifdef CONFIG_DEBUG_FS
 #include <linux/debugfs.h>
 
+static struct hlist_head *all_lists[] = {
+	&clk_root_list,
+	&clk_orphan_list,
+	NULL,
+};
+
+static struct hlist_head *orphan_list[] = {
+	&clk_orphan_list,
+	NULL,
+};
+
 static struct dentry *rootdir;
 static int inited = 0;
 
Thanks for finding this.

Cheers,

Peter.

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

* Re: [PATCH 1/1] clk: Fix build warnings
  2014-06-30 13:37 ` Peter De Schrijver
@ 2014-07-01  6:28   ` Sachin Kamat
  0 siblings, 0 replies; 3+ messages in thread
From: Sachin Kamat @ 2014-07-01  6:28 UTC (permalink / raw)
  To: Peter De Schrijver; +Cc: linux-kernel, mturquette

On Mon, Jun 30, 2014 at 7:07 PM, Peter De Schrijver
<pdeschrijver@nvidia.com> wrote:
> On Mon, Jun 30, 2014 at 11:40:54AM +0200, Sachin Kamat wrote:
>> ‘all_lists’ and ‘orphan_list’ is accessed only when DEBUG_FS is defined.
>> Thus, make their compilation conditional to fix the below warnings introduced
>> by commit 27b8d5f723 ("clk: flatten clk tree in debugfs"):
>> drivers/clk/clk.c:40:27: warning: ‘all_lists’ defined but not used [-Wunused-variable]
>> drivers/clk/clk.c:46:27: warning: ‘orphan_list’ defined but not used [-Wunused-variable]
>>
>
> Maybe just move them inside the existing #ifdef CONFIG_DEBUG_FS / #endif?

That makes sense. Thanks for the hint. Will re-spin.

Regards,
Sachin.

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

end of thread, other threads:[~2014-07-01  6:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-30  9:40 [PATCH 1/1] clk: Fix build warnings Sachin Kamat
2014-06-30 13:37 ` Peter De Schrijver
2014-07-01  6:28   ` Sachin Kamat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®