]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
drivers/clk/clk_zynqmp.c: get rid of compiler warning for !CONFIG_CMD_CLK builds
authorPeter Korsgaard <peter@korsgaard.com>
Mon, 19 Jan 2026 09:54:37 +0000 (10:54 +0100)
committerMichal Simek <michal.simek@amd.com>
Tue, 10 Feb 2026 08:27:48 +0000 (09:27 +0100)
When built without CONFIG_CMD_CLK, we get a warning about the unused
clk_names variable:

../drivers/clk/clk_zynqmp.c:153:27: warning: ‘clk_names’ defined but not used [-Wunused-const-variable=]
  153 | static const char * const clk_names[clk_max] = {

So also guard it with CONFIG_CMD_CLK to get rid of that.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/20260119095437.2775081-2-peter@korsgaard.com
drivers/clk/clk_zynqmp.c

index 7a433a667a49510ccaf712fa97ad4386634a85e6..765cae92241dd4893b2f0bcf57a9ccc39a46415e 100644 (file)
@@ -150,6 +150,7 @@ enum zynqmp_clk {
        clk_max,
 };
 
+#if IS_ENABLED(CONFIG_CMD_CLK)
 static const char * const clk_names[clk_max] = {
        "iopll", "rpll", "apll", "dpll",
        "vpll", "iopll_to_fpd", "rpll_to_fpd",
@@ -177,6 +178,7 @@ static const char * const clk_names[clk_max] = {
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, "gem0_ref", "gem1_ref", "gem2_ref", "gem3_ref",
 };
+#endif
 
 static const u32 pll_src[][4] = {
        {apll, 0xff, dpll, vpll},               /* acpu */