Skip to contentSkip to conversation

clk: rockchip: Fix -Wunused-const-variable

PATCH In review Nathan Huckleberry 4 participants 6 messages Jun 27, 2019 – Jul 25, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clk: rockchip: Fix -Wunused-const-variable

Clang produces the following warning

drivers/clk/rockchip/clk-rv1108.c:125:7: warning: unused variable 'mux_pll_src_3plls_p' [-Wunused-const-variable]
PNAME(mux_pll_src_3plls_p) = { "apll", "gpll", "dpll" };

Looks like this variable was never used. Deleting it to remove the warning.

---
 drivers/clk/rockchip/clk-rv1108.c | 1 -
 1 file changed, 1 deletion(-)
drivers/clk/rockchip/clk-rv1108.c +0 -1
index 96cc6af5632c..5947d3192866 100644
@@ -122,7 +122,6 @@ PNAME(mux_usb480m_pre_p)	= { "usbphy", "xin24m" };
 PNAME(mux_hdmiphy_phy_p)	= { "hdmiphy", "xin24m" };
 PNAME(mux_dclk_hdmiphy_pre_p)	= { "dclk_hdmiphy_src_gpll", "dclk_hdmiphy_src_dpll" };
 PNAME(mux_pll_src_4plls_p)	= { "dpll", "gpll", "hdmiphy", "usb480m" };
-PNAME(mux_pll_src_3plls_p)	= { "apll", "gpll", "dpll" };
 PNAME(mux_pll_src_2plls_p)	= { "dpll", "gpll" };
 PNAME(mux_pll_src_apll_gpll_p)	= { "apll", "gpll" };
 PNAME(mux_aclk_peri_src_p)	= { "aclk_peri_src_gpll", "aclk_peri_src_dpll" };
Signature · 1 line
2.22.0.410.gd8fdbe21b5-goog
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Nathan Huckleberry' via Clang Built Linux

Clang produces the following warning

drivers/clk/rockchip/clk-rv1108.c:125:7: warning: unused variable 'mux_pll_src_3plls_p' [-Wunused-const-variable]
PNAME(mux_pll_src_3plls_p) = { "apll", "gpll", "dpll" };

Looks like this variable was never used. Deleting it to remove the warning.

Indeed, looks like it was dead when introduced in:
commit e44dde279492 ("clk: rockchip: add clock controller for rk1108")

I don't see a pattern between when mux_pll_src_4plls_p vs mux_pll_src_2plls_p is used, so it's not clear where or even if mux_pll_src_3plls_p should be used. Given that there hasn't been a response to your original question
(https://groups.google.com/forum/#!topic/clang-built-linux/NqJT9OPH5C8)
and this patch is no functional change as the variable is already dead, I don't think it will hurt to remove it. It should also boost the signal to noise ratio of this warning.

Thanks for looking into it, and the patch.

drivers/clk/rockchip/clk-rv1108.c PNAME(mux_usb480m_pre_p) = { "usbphy", "xin24m" }; · line 125

Quoted 9 lines
drivers/clk/rockchip/clk-rv1108.c +0 -1
index 96cc6af5632c..5947d3192866 100644
@@ -122,7 +122,6 @@ PNAME(mux_usb480m_pre_p)    = { "usbphy", "xin24m" };
 PNAME(mux_hdmiphy_phy_p)       = { "hdmiphy", "xin24m" };
 PNAME(mux_dclk_hdmiphy_pre_p)  = { "dclk_hdmiphy_src_gpll", "dclk_hdmiphy_src_dpll" };
 PNAME(mux_pll_src_4plls_p)     = { "dpll", "gpll", "hdmiphy", "usb480m" };
-PNAME(mux_pll_src_3plls_p)     = { "apll", "gpll", "dpll" };

Thanks,
~Nick Desaulniers

maintainer
#2 lore raw

Am Freitag, 28. Juni 2019, 00:32:38 CEST schrieb Nick Desaulniers:

Quoted 12 lines
Quoted 9 lines · Nathan Huckleberry' via Clang Built Linux

Clang produces the following warning

drivers/clk/rockchip/clk-rv1108.c:125:7: warning: unused variable 'mux_pll_src_3plls_p' [-Wunused-const-variable]
PNAME(mux_pll_src_3plls_p) = { "apll", "gpll", "dpll" };

Looks like this variable was never used. Deleting it to remove the warning.

Quoted 6 lines

Indeed, looks like it was dead when introduced in:
commit e44dde279492 ("clk: rockchip: add clock controller for rk1108")

I don't see a pattern between when mux_pll_src_4plls_p vs mux_pll_src_2plls_p is used, so it's not clear where or even if mux_pll_src_3plls_p should be used.

The possible sources for a clock really differ often, so there is no general rule on when to use which sources ... except looking it up in the soc manual. And I guess any possible conflict will turn up when someone wants to use a clock that currently may reference the wrong sources.

maintainer
#3 lore raw
In reply to Nathan Huckleberry

Quoting Nathan Huckleberry (2019-06-27 15:22:20)

Quoted 9 lines

Clang produces the following warning

drivers/clk/rockchip/clk-rv1108.c:125:7: warning: unused variable 'mux_pll_src_3plls_p' [-Wunused-const-variable]
PNAME(mux_pll_src_3plls_p) = { "apll", "gpll", "dpll" };

Looks like this variable was never used. Deleting it to remove the warning.

Quoted 6 lines
---
 drivers/clk/rockchip/clk-rv1108.c | 1 -
 1 file changed, 1 deletion(-)

Heiko, can you pick this up? Looks like v5.4 material.

Quoted 13 lines
drivers/clk/rockchip/clk-rv1108.c +0 -1
index 96cc6af5632c..5947d3192866 100644
@@ -122,7 +122,6 @@ PNAME(mux_usb480m_pre_p)    = { "usbphy", "xin24m" };
 PNAME(mux_hdmiphy_phy_p)       = { "hdmiphy", "xin24m" };
 PNAME(mux_dclk_hdmiphy_pre_p)  = { "dclk_hdmiphy_src_gpll", "dclk_hdmiphy_src_dpll" };
 PNAME(mux_pll_src_4plls_p)     = { "dpll", "gpll", "hdmiphy", "usb480m" };
-PNAME(mux_pll_src_3plls_p)     = { "apll", "gpll", "dpll" };
 PNAME(mux_pll_src_2plls_p)     = { "dpll", "gpll" };
 PNAME(mux_pll_src_apll_gpll_p) = { "apll", "gpll" };
 PNAME(mux_aclk_peri_src_p)     = { "aclk_peri_src_gpll", "aclk_peri_src_dpll" };
maintainer
#4 lore raw

Hi Stephen,

Am Montag, 22. Juli 2019, 23:35:18 CEST schrieb Stephen Boyd:

Quoted 10 lines

Quoting Nathan Huckleberry (2019-06-27 15:22:20)

Quoted 9 lines

Clang produces the following warning

drivers/clk/rockchip/clk-rv1108.c:125:7: warning: unused variable 'mux_pll_src_3plls_p' [-Wunused-const-variable]
PNAME(mux_pll_src_3plls_p) = { "apll", "gpll", "dpll" };

Looks like this variable was never used. Deleting it to remove the warning.

Quoted 8 lines
Quoted 6 lines
---
 drivers/clk/rockchip/clk-rv1108.c | 1 -
 1 file changed, 1 deletion(-)

Heiko, can you pick this up? Looks like v5.4 material.

yep ... I'm planning to do that :-)

Heiko

Quoted 12 lines
Quoted 12 lines
drivers/clk/rockchip/clk-rv1108.c +0 -1
index 96cc6af5632c..5947d3192866 100644
@@ -122,7 +122,6 @@ PNAME(mux_usb480m_pre_p)    = { "usbphy", "xin24m" };
 PNAME(mux_hdmiphy_phy_p)       = { "hdmiphy", "xin24m" };
 PNAME(mux_dclk_hdmiphy_pre_p)  = { "dclk_hdmiphy_src_gpll", "dclk_hdmiphy_src_dpll" };
 PNAME(mux_pll_src_4plls_p)     = { "dpll", "gpll", "hdmiphy", "usb480m" };
-PNAME(mux_pll_src_3plls_p)     = { "apll", "gpll", "dpll" };
 PNAME(mux_pll_src_2plls_p)     = { "dpll", "gpll" };
 PNAME(mux_pll_src_apll_gpll_p) = { "apll", "gpll" };
 PNAME(mux_aclk_peri_src_p)     = { "aclk_peri_src_gpll", "aclk_peri_src_dpll" };
maintainer
#5 lore raw
In reply to Nathan Huckleberry

Am Freitag, 28. Juni 2019, 00:22:20 CEST schrieb Nathan Huckleberry:

Quoted 6 lines

Clang produces the following warning

drivers/clk/rockchip/clk-rv1108.c:125:7: warning: unused variable 'mux_pll_src_3plls_p' [-Wunused-const-variable]
PNAME(mux_pll_src_3plls_p) = { "apll", "gpll", "dpll" };

Quoted 6 lines

Looks like this variable was never used. Deleting it to remove the warning.

applied for 5.4

Thanks
Heiko