clk: rockchip: Fix -Wunused-const-variable
Subsystems (2)
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
@@ -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
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@@ -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
Heiko Stuebner
maintainerAm 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:
commite44dde279492("clk: rockchip: add clock controller for rk1108")I don't see a pattern between when
mux_pll_src_4plls_pvsmux_pll_src_2plls_pis used, so it's not clear where or even ifmux_pll_src_3plls_pshould 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.
Stephen Boyd
maintainerQuoting 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
Signed-off-by Nathan Huckleberry <[email protected]>--- 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@@ -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" };
Heiko Stuebner
maintainerHi 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
Signed-off-by Nathan Huckleberry <[email protected]>--- 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@@ -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" };
Heiko Stuebner
maintainerAm 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