2024-04-03 08:23:22

by Arnd Bergmann

[permalink] [raw]
Subject: [PATCH 11/34] clk: ti: dpll: fix incorrect #ifdef checks

From: Arnd Bergmann <[email protected]>

Building with W=1 shows warnings about unused const variables like this one:

drivers/clk/ti/dpll.c:99:29: error: unused variable 'omap3_dpll_core_ck_ops' [-Werror,-Wunused-const-variable]
static const struct clk_ops omap3_dpll_core_ck_ops = {};

The problem is that the #ifdef checks for some of the structures in this
file have gone out of sync with the code referencing them. Update these
to match the current usage.

Signed-off-by: Arnd Bergmann <[email protected]>
---
drivers/clk/ti/dpll.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/clk/ti/dpll.c b/drivers/clk/ti/dpll.c
index 403ec81f561b..3386bd1903df 100644
--- a/drivers/clk/ti/dpll.c
+++ b/drivers/clk/ti/dpll.c
@@ -34,8 +34,6 @@ static const struct clk_ops dpll_m4xen_ck_ops = {
.save_context = &omap3_core_dpll_save_context,
.restore_context = &omap3_core_dpll_restore_context,
};
-#else
-static const struct clk_ops dpll_m4xen_ck_ops = {};
#endif

#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) || \
@@ -95,11 +93,7 @@ static const struct clk_ops omap3_dpll_core_ck_ops = {
.recalc_rate = &omap3_dpll_recalc,
.round_rate = &omap2_dpll_round_rate,
};
-#else
-static const struct clk_ops omap3_dpll_core_ck_ops = {};
-#endif

-#ifdef CONFIG_ARCH_OMAP3
static const struct clk_ops omap3_dpll_ck_ops = {
.enable = &omap3_noncore_dpll_enable,
.disable = &omap3_noncore_dpll_disable,
@@ -137,9 +131,13 @@ static const struct clk_ops omap3_dpll_per_ck_ops = {
};
#endif

+#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \
+ defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM33XX) || \
+ defined(CONFIG_SOC_AM43XX)
static const struct clk_ops dpll_x2_ck_ops = {
.recalc_rate = &omap3_clkoutx2_recalc,
};
+#endif

/**
* _register_dpll - low level registration of a DPLL clock
--
2.39.2



2024-04-03 09:01:27

by Tony Lindgren

[permalink] [raw]
Subject: Re: [PATCH 11/34] clk: ti: dpll: fix incorrect #ifdef checks

* Arnd Bergmann <[email protected]> [240403 08:18]:
> The problem is that the #ifdef checks for some of the structures in this
> file have gone out of sync with the code referencing them. Update these
> to match the current usage.

Looks good to me:

Reviewed-by: Tony Lindgren <[email protected]>

2024-04-05 21:14:06

by Stephen Boyd

[permalink] [raw]
Subject: Re: [PATCH 11/34] clk: ti: dpll: fix incorrect #ifdef checks

Quoting Arnd Bergmann (2024-04-03 01:06:29)
> From: Arnd Bergmann <[email protected]>
>
> Building with W=1 shows warnings about unused const variables like this one:
>
> drivers/clk/ti/dpll.c:99:29: error: unused variable 'omap3_dpll_core_ck_ops' [-Werror,-Wunused-const-variable]
> static const struct clk_ops omap3_dpll_core_ck_ops = {};
>
> The problem is that the #ifdef checks for some of the structures in this
> file have gone out of sync with the code referencing them. Update these
> to match the current usage.
>
> Signed-off-by: Arnd Bergmann <[email protected]>
> ---

Applied to clk-next