mediatek: backport upstream mediatek patches
[openwrt/openwrt.git] / target / linux / mediatek / patches-4.14 / 0176-clk-mediatek-Fix-all-warnings-for-missing-struct-clk.patch
1 From f42f141077a12e28fe33c0033f698afb1402ec20 Mon Sep 17 00:00:00 2001
2 From: Sean Wang <sean.wang@mediatek.com>
3 Date: Mon, 25 Dec 2017 16:03:57 +0800
4 Subject: [PATCH 176/224] clk: mediatek: Fix all warnings for missing struct
5 clk_onecell_data
6
7 Even though the header file linux/clk-provider.h is already being properly
8 included in clk-mtk.h, the definition of struct clk_onecell_data still
9 must depend on CONFIG_COMMON_CLK defined and thus it's possible that
10 below build warnings occur when CONFIG_COMMON_CLK is not being selected.
11
12 Therefore, these functions which need struct clk_onecell_data without
13 declaring that structure first requires simply declaring that this struct
14 exists prior to referencing it in clk-mtk.h
15
16 Changes from v1->v2:
17 enhance v1 based on two useful solutions Jean Delvare kindly suggested.
18
19 All warnings (new ones prefixed by >>):
20
21 In file included from drivers/clk/mediatek/reset.c:22:0:
22 >>drivers/clk/mediatek/clk-mtk.h:44:19: warning: 'struct clk_onecell_data'
23 declared inside parameter list will not be visible outside of
24 this definition or declaration
25 int num, struct clk_onecell_data *clk_data);
26 ^~~~~~~~~~~~~~~~
27 drivers/clk/mediatek/clk-mtk.h:63:19: warning: 'struct clk_onecell_data'
28 declared inside parameter list will not be visible outside of
29 this definition or declaration
30 int num, struct clk_onecell_data *clk_data);
31 ^~~~~~~~~~~~~~~~
32 drivers/clk/mediatek/clk-mtk.h:145:10: warning: 'struct clk_onecell_data'
33 declared inside parameter list will not be visible outside of
34 this definition or declaration
35 struct clk_onecell_data *clk_data);
36 ^~~~~~~~~~~~~~~~
37 drivers/clk/mediatek/clk-mtk.h:164:11: warning: 'struct clk_onecell_data'
38 declared inside parameter list will not be visible outside of
39 this definition or declaration
40 struct clk_onecell_data *clk_data);
41 ^~~~~~~~~~~~~~~~
42 drivers/clk/mediatek/clk-mtk.h:190:12: warning: 'struct clk_onecell_data'
43 declared inside parameter list will not be visible outside of this
44 definition or declaration
45 struct clk_onecell_data *clk_data);
46 ^~~~~~~~~~~~~~~~
47
48 Reported-by: kbuild test robot <fengguang.wu@intel.com>
49 Signed-off-by: Sean Wang <sean.wang@mediatek.com>
50 Cc: kbuild-all@01.org
51 Cc: Stephen Boyd <sboyd@codeaurora.org>
52 Cc: Jean Delvare <jdelvare@suse.de>
53 Cc: linux-clk@vger.kernel.org
54 Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
55 ---
56 drivers/clk/mediatek/clk-mtk.h | 1 +
57 1 file changed, 1 insertion(+)
58
59 diff --git a/drivers/clk/mediatek/clk-mtk.h b/drivers/clk/mediatek/clk-mtk.h
60 index f10250dcece4..bf8006d41861 100644
61 --- a/drivers/clk/mediatek/clk-mtk.h
62 +++ b/drivers/clk/mediatek/clk-mtk.h
63 @@ -20,6 +20,7 @@
64 #include <linux/clk-provider.h>
65
66 struct clk;
67 +struct clk_onecell_data;
68
69 #define MAX_MUX_GATE_BIT 31
70 #define INVALID_MUX_GATE_BIT (MAX_MUX_GATE_BIT + 1)
71 --
72 2.11.0
73