Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: Fix build warnings

‘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>
Signed-off-by: Mike Turquette <mturquette@linaro.org>

authored by

Sachin Kamat and committed by
Mike Turquette
6b44c854 da788acb

+11 -11
+11 -11
drivers/clk/clk.c
··· 36 36 static HLIST_HEAD(clk_orphan_list); 37 37 static LIST_HEAD(clk_notifier_list); 38 38 39 - static struct hlist_head *all_lists[] = { 40 - &clk_root_list, 41 - &clk_orphan_list, 42 - NULL, 43 - }; 44 - 45 - static struct hlist_head *orphan_list[] = { 46 - &clk_orphan_list, 47 - NULL, 48 - }; 49 - 50 39 /*** locking ***/ 51 40 static void clk_prepare_lock(void) 52 41 { ··· 99 110 100 111 static struct dentry *rootdir; 101 112 static int inited = 0; 113 + 114 + static struct hlist_head *all_lists[] = { 115 + &clk_root_list, 116 + &clk_orphan_list, 117 + NULL, 118 + }; 119 + 120 + static struct hlist_head *orphan_list[] = { 121 + &clk_orphan_list, 122 + NULL, 123 + }; 102 124 103 125 static void clk_summary_show_one(struct seq_file *s, struct clk *c, int level) 104 126 {