All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/6] rockchip: clk: rk3399: fix warnings for unused variables in SPL/non-SPL
Date: Fri, 24 Mar 2017 19:24:24 +0100	[thread overview]
Message-ID: <1490379869-47505-3-git-send-email-philipp.tomsich@theobroma-systems.com> (raw)
In-Reply-To: <1490379869-47505-1-git-send-email-philipp.tomsich@theobroma-systems.com>

Due to differences in the code paths for SPL and non-SPL, some static
constant structures remain unused in each build variant. This raises
warnings with recent GCC versions (we currently use GCC-6.3).

The warnings addressed in this commit (by matching #if conditions for
the variable definition with their uses) are:

* for the SPL build:
    drivers/clk/rockchip/clk_rk3399.c:53:29: warning: 'cpll_init_cfg' defined but not used [-Wunused-const-variable=]
     static const struct pll_div cpll_init_cfg = PLL_DIVISORS(CPLL_HZ, 1, 2, 2);
                                 ^~~~~~~~~~~~~
    drivers/clk/rockchip/clk_rk3399.c:52:29: warning: 'gpll_init_cfg' defined but not used [-Wunused-const-variable=]
     static const struct pll_div gpll_init_cfg = PLL_DIVISORS(GPLL_HZ, 2, 2, 1);
                                 ^~~~~~~~~~~~~
* for the non-SPL build:
    drivers/clk/rockchip/clk_rk3399.c:54:29: warning: 'ppll_init_cfg' defined but not used [-Wunused-const-variable=]
     static const struct pll_div ppll_init_cfg = PLL_DIVISORS(PPLL_HZ, 2, 2, 1);
                                 ^~~~~~~~~~~~~

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
---

 drivers/clk/rockchip/clk_rk3399.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/clk/rockchip/clk_rk3399.c b/drivers/clk/rockchip/clk_rk3399.c
index 922ce7e..453c6dd 100644
--- a/drivers/clk/rockchip/clk_rk3399.c
+++ b/drivers/clk/rockchip/clk_rk3399.c
@@ -47,9 +47,12 @@ struct pll_div {
 	.fbdiv = (u32)((u64)hz * _refdiv * _postdiv1 * _postdiv2 / OSC_HZ),\
 	.postdiv1 = _postdiv1, .postdiv2 = _postdiv2};
 
+#if defined(CONFIG_SPL_BUILD)
 static const struct pll_div gpll_init_cfg = PLL_DIVISORS(GPLL_HZ, 2, 2, 1);
 static const struct pll_div cpll_init_cfg = PLL_DIVISORS(CPLL_HZ, 1, 2, 2);
+#else
 static const struct pll_div ppll_init_cfg = PLL_DIVISORS(PPLL_HZ, 2, 2, 1);
+#endif
 
 static const struct pll_div apll_l_1600_cfg = PLL_DIVISORS(1600*MHz, 3, 1, 1);
 static const struct pll_div apll_l_600_cfg = PLL_DIVISORS(600*MHz, 1, 2, 1);
@@ -1009,7 +1012,9 @@ static void pmuclk_init(struct rk3399_pmucru *pmucru)
 
 static int rk3399_pmuclk_probe(struct udevice *dev)
 {
+#if CONFIG_IS_ENABLED(OF_PLATDATA) || !defined(CONFIG_SPL_BUILD)
 	struct rk3399_pmuclk_priv *priv = dev_get_priv(dev);
+#endif
 
 #if CONFIG_IS_ENABLED(OF_PLATDATA)
 	struct rk3399_pmuclk_plat *plat = dev_get_platdata(dev);
-- 
1.9.1

  parent reply	other threads:[~2017-03-24 18:24 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-24 18:24 [U-Boot] [PATCH 0/6] rockchip: rk3399: GMAC support for the RK3399 SoC Philipp Tomsich
2017-03-24 18:24 ` [U-Boot] [PATCH 1/6] rockchip: pinctrl: rk3399: add GMAC (RGMII only) support Philipp Tomsich
2017-03-26  3:47   ` Simon Glass
2017-04-02  0:05     ` Simon Glass
2017-03-24 18:24 ` Philipp Tomsich [this message]
2017-03-26  3:48   ` [U-Boot] [PATCH 2/6] rockchip: clk: rk3399: fix warnings for unused variables in SPL/non-SPL Simon Glass
2017-04-02  0:05     ` Simon Glass
2017-03-24 18:24 ` [U-Boot] [PATCH 3/6] rockchip: clk: rk3399: add clocking support for Ethernet Philipp Tomsich
2017-03-26  3:48   ` Simon Glass
2017-04-02  0:05     ` Simon Glass
2017-03-24 18:24 ` [U-Boot] [PATCH 4/6] net: gmac_rockchip: Add support for the RK3399 GMAC Philipp Tomsich
2017-03-25 19:09   ` Joe Hershberger
2017-03-26  3:48     ` Simon Glass
2017-03-26 13:52       ` Joe Hershberger
2017-04-02  0:05         ` Simon Glass
2017-03-24 18:24 ` [U-Boot] [PATCH 5/6] dts: rk3399: add gmac for the rk3399 Philipp Tomsich
2017-03-26  3:48   ` Simon Glass
2017-04-02  0:05     ` Simon Glass
2017-03-24 18:24 ` [U-Boot] [PATCH 6/6] dts: rk3399-puma: add gmac for the RK3399-Q7 Philipp Tomsich
2017-03-26  3:48   ` Simon Glass
2017-03-26 16:24     ` Dr. Philipp Tomsich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1490379869-47505-3-git-send-email-philipp.tomsich@theobroma-systems.com \
    --to=philipp.tomsich@theobroma-systems.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.