linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] clk: qcom: fix build error initializer element is not constant
@ 2022-07-14 12:11 Ren Zhijie
  2022-07-17  3:08 ` Bjorn Andersson
  0 siblings, 1 reply; 2+ messages in thread
From: Ren Zhijie @ 2022-07-14 12:11 UTC (permalink / raw)
  To: agross, bjorn.andersson, konrad.dybcio, mturquette, sboyd,
	jonathan, robert.foss, vkoul
  Cc: linux-arm-msm, linux-clk, linux-kernel, Ren Zhijie

CONFIG_CC_VERSION_TEXT="x86_64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0"
make ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu-, will be failed, like this:

drivers/clk/qcom/gpucc-sm8350.c:111:2: error: initializer element is not constant
  gpu_cc_parent,
  ^~~~~~~~~~~~~
drivers/clk/qcom/gpucc-sm8350.c:111:2: note: (near initialization for ‘gpu_cc_parent_data_0[0]’)
drivers/clk/qcom/gpucc-sm8350.c:126:2: error: initializer element is not constant
  gpu_cc_parent,
  ^~~~~~~~~~~~~
drivers/clk/qcom/gpucc-sm8350.c:126:2: note: (near initialization for ‘gpu_cc_parent_data_1[0]’)
make[3]: *** [drivers/clk/qcom/gpucc-sm8350.o] Error 1

It seems that nested constant initializer is not supported in GCC 7.4.0. For portability resons, we should fix it.

Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: 160758b05ab1 ("clk: qcom: add support for SM8350 GPUCC")
Signed-off-by: Ren Zhijie <renzhijie2@huawei.com>
---
 drivers/clk/qcom/gpucc-sm8350.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/qcom/gpucc-sm8350.c b/drivers/clk/qcom/gpucc-sm8350.c
index d13fa813d190..5367ce654ac9 100644
--- a/drivers/clk/qcom/gpucc-sm8350.c
+++ b/drivers/clk/qcom/gpucc-sm8350.c
@@ -108,7 +108,7 @@ static const struct parent_map gpu_cc_parent_map_0[] = {
 };
 
 static const struct clk_parent_data gpu_cc_parent_data_0[] = {
-	gpu_cc_parent,
+	{ .fw_name = "bi_tcxo" },
 	{ .hw = &gpu_cc_pll0.clkr.hw },
 	{ .hw = &gpu_cc_pll1.clkr.hw },
 	{ .fw_name = "gcc_gpu_gpll0_clk_src" },
@@ -123,7 +123,7 @@ static const struct parent_map gpu_cc_parent_map_1[] = {
 };
 
 static const struct clk_parent_data gpu_cc_parent_data_1[] = {
-	gpu_cc_parent,
+	{ .fw_name = "bi_tcxo" },
 	{ .hw = &gpu_cc_pll1.clkr.hw },
 	{ .fw_name = "gcc_gpu_gpll0_clk_src" },
 	{ .fw_name = "gcc_gpu_gpll0_div_clk_src" },
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] clk: qcom: fix build error initializer element is not constant
  2022-07-14 12:11 [PATCH -next] clk: qcom: fix build error initializer element is not constant Ren Zhijie
@ 2022-07-17  3:08 ` Bjorn Andersson
  0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Andersson @ 2022-07-17  3:08 UTC (permalink / raw)
  To: vkoul, Ren Zhijie, mturquette, sboyd, robert.foss, agross,
	jonathan, konrad.dybcio
  Cc: linux-arm-msm, linux-clk, linux-kernel

On Thu, 14 Jul 2022 20:11:44 +0800, Ren Zhijie wrote:
> CONFIG_CC_VERSION_TEXT="x86_64-linux-gnu-gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0"
> make ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu-, will be failed, like this:
> 
> drivers/clk/qcom/gpucc-sm8350.c:111:2: error: initializer element is not constant
>   gpu_cc_parent,
>   ^~~~~~~~~~~~~
> drivers/clk/qcom/gpucc-sm8350.c:111:2: note: (near initialization for ‘gpu_cc_parent_data_0[0]’)
> drivers/clk/qcom/gpucc-sm8350.c:126:2: error: initializer element is not constant
>   gpu_cc_parent,
>   ^~~~~~~~~~~~~
> drivers/clk/qcom/gpucc-sm8350.c:126:2: note: (near initialization for ‘gpu_cc_parent_data_1[0]’)
> make[3]: *** [drivers/clk/qcom/gpucc-sm8350.o] Error 1
> 
> [...]

Applied, thanks!

[1/1] clk: qcom: fix build error initializer element is not constant
      commit: b5eb8cde863cdf455436c7ba3fb7362c49e1e64e

Best regards,
-- 
Bjorn Andersson <bjorn.andersson@linaro.org>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-07-17  3:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-14 12:11 [PATCH -next] clk: qcom: fix build error initializer element is not constant Ren Zhijie
2022-07-17  3:08 ` Bjorn Andersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).