Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3582531imw; Mon, 11 Jul 2022 11:21:49 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vdZXoe9L2uN+v3B+TW8wv43FaiL9ak/L57pvTeFSSXD81I8RaFk/fAuqx+nk22UmYoHSd7 X-Received: by 2002:a05:6402:4395:b0:43a:c694:907d with SMTP id o21-20020a056402439500b0043ac694907dmr14739461edc.310.1657563709360; Mon, 11 Jul 2022 11:21:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657563709; cv=none; d=google.com; s=arc-20160816; b=qDfyaRbzskmR9hWUaRDl+CBUX8WoniHTIvrnk8YYWKTR8htAQWloOEsCi5om8ADJP6 xUNmxvrWpKLOWEgcJpuy+epKXARbwGCApMIy2s8uBTj8yhlm7oCo4QSYbMe4EenIUm0r oLGc+79q/FAO5oa/eKx+ipoh0/Mppa6EgiX7j/Rv5FwMqNbjLQLhnU/M5d+N8XP78hH4 k8vENOMDSem6NA9jRWLTbt92rRrfu1/wfSkIK7ENMz6aIeBcsiY2E/63g4M/Hk8+uEXZ y2HtaNGDcMyM+vmN0MKuH8wsSpv1onqy+N+zYKYxj168tUVFvAjYL07CCmcfJDWjtFHB gYdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=YRKpkfAENwaPRHhB52Yk4IsL9JC0VBqj2njlYrjdEfc=; b=dAKPYf5m1RLo3GH0NlBELhQiF91geEgsBV04Hb/HOqXeRfBq635clEW6s72twgsW0G Rm7GNB9lOrMVsJSs/mlgceeCG0WVkHdOeAw5uMwNLPK9AN2lJN9bCKzST0e4DJ9Qma6j P7/4DL3QfXM4sOOTA14QhbEGLvjBOJcV3/STb3IvD9Xq+VlP5SpcEuRtEP9TV0q015J3 K+/KPKLTr4NuU21w3zrZAWGxGM4e6LyvHdqhhVGrOEWQifzr8CSVpQa7fn6ips5/hnTP e36uIQ5MZoL37tzvh3r6nYogTc9itRZT/ADwCRsVx0Jn+5iUQNX74wZls3jCo9HW6oS/ SHng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Jjs1SJg9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h6-20020a05640250c600b0043a25094b50si12646660edb.552.2022.07.11.11.21.23; Mon, 11 Jul 2022 11:21:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Jjs1SJg9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231638AbiGKRmd (ORCPT + 99 others); Mon, 11 Jul 2022 13:42:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230180AbiGKRmc (ORCPT ); Mon, 11 Jul 2022 13:42:32 -0400 Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACFA16E8B0 for ; Mon, 11 Jul 2022 10:42:30 -0700 (PDT) Received: by mail-qt1-x831.google.com with SMTP id i21so6314220qtw.12 for ; Mon, 11 Jul 2022 10:42:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YRKpkfAENwaPRHhB52Yk4IsL9JC0VBqj2njlYrjdEfc=; b=Jjs1SJg9ILwBRwrSz85ksnjxvXlcJlYxLcWsAIFy3D+w2CMbVk02Fy90YtRHuT/Gsc 7w5I36ok/ezLiv0MwRRSqurKUV8r1WuOn8R/X3vRaSNrl827XgHpwFoNz/xUzBRULcci L2aqTcvr+66l1s0HQsMiDICOiSJlXIUIv0TPQlgFJWyNl+vWFrPal7NgW67WfkDXCkSC On0BlPDuU6OXJUGyN3dDD3HqfV8lELBhAv1dWi6blk7Or/nGbVhfPLfCUMtASG4f0s/h L0SaBtWy0rvA4iVO3GMVZsBuyNVP5u3nC7OLidScTPhquFtAT8UtRBmdn5VFJI0EE9bM ilRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YRKpkfAENwaPRHhB52Yk4IsL9JC0VBqj2njlYrjdEfc=; b=4MfOfS45C2lmkU2wsYCKxUIJ8p+zH8lzQkfWOqEAp+QgAOHpoFE1Jw9mhG/rwxVXM/ Xr69dJAv6WlvHj+z0aeXTjvAJPEQG1NDW49pDiYnpLi0H7p7jqX618RhqUj1gi7G0XF3 5u45+rf4I81KknMUiztYETn0x84iaT82p0vsEuZjO8G/E2vUyKx/7bY5Z5rx8PuDZOeN 96cXab7BjV3l89N5kBXSommqEm+c3ckUhcyiGAfjaPT3MT9V4RcRDvQ6L15Rkp8fbWmP g/vIzsn6JubCf08CgrHqpQPNlMH6ZIQfU4hCHVeAW0OHMWzDkIsNEpM1MIWx4jhw5tLO P5lQ== X-Gm-Message-State: AJIora9rlD10E73S2JkjckUhpkc7WkKC/FnjtSPy1/3KYzOmpzQR/jHy C6DkxGbcTFYZxlLQTAUZX+kqDt+5roQkwdhoBBhYGw== X-Received: by 2002:a05:622a:198f:b0:31e:b669:9f29 with SMTP id u15-20020a05622a198f00b0031eb6699f29mr3742937qtc.629.1657561349814; Mon, 11 Jul 2022 10:42:29 -0700 (PDT) MIME-Version: 1.0 References: <20220711174004.3047516-1-nathan@kernel.org> In-Reply-To: <20220711174004.3047516-1-nathan@kernel.org> From: Dmitry Baryshkov Date: Mon, 11 Jul 2022 20:42:18 +0300 Message-ID: Subject: Re: [PATCH v2] clk: qcom: gpucc-sm8350: Fix "initializer element is not constant" error To: Nathan Chancellor Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Michael Turquette , Stephen Boyd , Nick Desaulniers , Tom Rix , Robert Foss , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, kernel test robot Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 11 Jul 2022 at 20:41, Nathan Chancellor wrote: > > When building with clang or GCC older than 8, errors along the following > lines occur: > > drivers/clk/qcom/gpucc-sm8350.c:111:2: error: initializer element is not a compile-time constant > gpu_cc_parent, > ^~~~~~~~~~~~~ > drivers/clk/qcom/gpucc-sm8350.c:126:2: error: initializer element is not a compile-time constant > gpu_cc_parent, > ^~~~~~~~~~~~~ > 2 errors generated. > > The C standard allows an implementation to accept other forms of > constant expressions, which GCC 8+ has chosen to do, but it is not > required. Just inline the initializer to resolve the error. > > Fixes: 160758b05ab1 ("clk: qcom: add support for SM8350 GPUCC") > Link: https://github.com/ClangBuiltLinux/linux/issues/1660 > Reported-by: kernel test robot > Signed-off-by: Nathan Chancellor Reviewed-by: Dmitry Baryshkov > --- > > v1 -> v2: https://lore.kernel.org/20220711163021.152578-1-nathan@kernel.org/ > > * Just inline the initializer, rather than using a macro (Dmitry). > > 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" }, > > base-commit: 0dd8e16bfbc003b009f843e75fae4046daa08fe9 > -- > 2.37.0 > -- With best wishes Dmitry