public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jacob Keller <jacob.e.keller@intel.com>
To: Mark O'Donovan <shiftee@posteo.net>, <linux-kernel@vger.kernel.org>
Cc: <alexandre.torgue@foss.st.com>, <joabreu@synopsys.com>,
	<davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
	<pabeni@redhat.com>, <mcoquelin.stm32@gmail.com>,
	<netdev@vger.kernel.org>,
	<linux-stm32@st-md-mailman.stormreply.com>,
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] net: stmmac: xgmac: fix initializer element is not constant error
Date: Wed, 14 Feb 2024 12:31:35 -0800	[thread overview]
Message-ID: <44c29a45-86fa-4e41-b4b5-e69187f0712e@intel.com> (raw)
In-Reply-To: <20240212154319.907447-1-shiftee@posteo.net>



On 2/12/2024 7:43 AM, Mark O'Donovan wrote:
> GCC prior to 8.x gives an "initializer element is not constant"
> error for the uses of dpp_tx_err in dwxgmac3_dma_dpp_errors.
> Newer compilers accept either version.
> 
> More info here:
> https://lore.kernel.org/all/20240103-fix-bq24190_charger-vbus_desc-non-const-v1-1-115ddf798c70@kernel.org
> 
> Signed-off-by: Mark O'Donovan <shiftee@posteo.net>
> ---

I'm not sure whether the Linux kernel project has an explicit cutoff for
what versions of GCC (or other compilers) are supported. GCC 8 was first
released in 2018.

The fix provided here is fairly straight forward, and while I do think
the benefit of using builtin types vs using the macros is nice, I don't
see that as a strong enough reason to hold up supporting the older compiler.

Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>

>  drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
> index 323c57f03c93..c02c035b81c0 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
> @@ -830,8 +830,8 @@ static const struct dwxgmac3_error_desc dwxgmac3_dma_errors[32]= {
>  	{ false, "UNKNOWN", "Unknown Error" }, /* 31 */
>  };
>  
> -static const char * const dpp_rx_err = "Read Rx Descriptor Parity checker Error";
> -static const char * const dpp_tx_err = "Read Tx Descriptor Parity checker Error";
> +#define dpp_rx_err "Read Rx Descriptor Parity checker Error"
> +#define dpp_tx_err "Read Tx Descriptor Parity checker Error"
>  static const struct dwxgmac3_error_desc dwxgmac3_dma_dpp_errors[32] = {
>  	{ true, "TDPES0", dpp_tx_err },
>  	{ true, "TDPES1", dpp_tx_err },
> 
> base-commit: 841c35169323cd833294798e58b9bf63fa4fa1de

  reply	other threads:[~2024-02-14 20:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-12 15:43 [PATCH] net: stmmac: xgmac: fix initializer element is not constant error Mark O'Donovan
2024-02-14 20:31 ` Jacob Keller [this message]
2024-02-14 22:07   ` Mark O'Donovan
2024-02-15 10:47     ` Paolo Abeni
2024-02-15 17:31     ` Jacob Keller

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=44c29a45-86fa-4e41-b4b5-e69187f0712e@intel.com \
    --to=jacob.e.keller@intel.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=joabreu@synopsys.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shiftee@posteo.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox