devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Okan Sahin <okan.sahin@analog.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Ibrahim Tilki <Ibrahim.Tilki@analog.com>,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	llvm@lists.linux.dev
Subject: Re: [PATCH v3 2/2] regulator: max77857: Add ADI MAX77857/59/MAX77831 Regulator Support
Date: Wed, 26 Jul 2023 09:10:33 -0700	[thread overview]
Message-ID: <20230726161033.GA1102409@dev-arch.thelio-3990X> (raw)
In-Reply-To: <20230718155502.GA3542993@dev-arch.thelio-3990X>

Hi Okan,

On Tue, Jul 18, 2023 at 08:55:02AM -0700, Nathan Chancellor wrote:

<snip>

> > +static struct regulator_desc max77857_regulator_desc = {
> > +	.ops = &max77857_regulator_ops,
> > +	.name = "max77857",
> > +	.linear_ranges = max77857_lin_ranges,
> > +	.n_linear_ranges = ARRAY_SIZE(max77857_lin_ranges),
> > +	.vsel_mask = 0xFF,
> > +	.vsel_reg = MAX77857_REG_CONT2,
> > +	.ramp_delay_table = max77857_ramp_table[0],
> > +	.n_ramp_values = ARRAY_SIZE(max77857_ramp_table[0]),
> > +	.ramp_reg = MAX77857_REG_CONT3,
> > +	.ramp_mask = GENMASK(1, 0),
> > +	.ramp_delay = max77857_ramp_table[0][0],
> 
> This breaks the build with GCC 5.x through 7.x:
> 
>   drivers/regulator/max77857-regulator.c:312:16: error: initializer element is not constant
>     .ramp_delay = max77857_ramp_table[0][0],
>                   ^~~~~~~~~~~~~~~~~~~
>   drivers/regulator/max77857-regulator.c:312:16: note: (near initialization for 'max77857_regulator_desc.ramp_delay')
> 
> and clang:
> 
>   drivers/regulator/max77857-regulator.c:312:16: error: initializer element is not a compile-time constant
>     312 |         .ramp_delay = max77857_ramp_table[0][0],
>         |                       ^~~~~~~~~~~~~~~~~~~~~~~~~
>   1 error generated.
> 
> This relies on a GCC 8.x+ change that accepts more things as
> compile-time constants, which is being worked on in clang
> (https://reviews.llvm.org/D76096). Since the kernel supports older
> compilers, this will have to be worked around somehow. Perhaps a define
> that can be used in both places?

Was there any update on this? I do not mind sending a patch for this
myself if I have some sort of guidance on how you would prefer for this
to be fixed, should you be too busy to look into it.

Cheers,
Nathan

  parent reply	other threads:[~2023-07-26 16:10 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-17  5:07 [PATCH v3 0/2] Add MAX77857/59/MAX77831 Regulator Support Okan Sahin
2023-07-17  5:07 ` [PATCH v3 1/2] dt-bindings: regulator: max77857: Add ADI MAX77857/59/MAX77831 Regulator Okan Sahin
2023-07-17  5:07 ` [PATCH v3 2/2] regulator: max77857: Add ADI MAX77857/59/MAX77831 Regulator Support Okan Sahin
2023-07-18 15:55   ` Nathan Chancellor
2023-07-18 17:25     ` Sahin, Okan
2023-07-18 17:28       ` Nathan Chancellor
2023-07-18 17:38       ` Mark Brown
2023-07-26 16:10     ` Nathan Chancellor [this message]
2023-07-27  8:34       ` Sahin, Okan
2023-07-27 14:51         ` Nathan Chancellor
2023-08-02 22:52           ` Nick Desaulniers
2023-08-02 23:02             ` Mark Brown
2023-08-02 23:04               ` Nathan Chancellor
2023-08-02 23:07                 ` Mark Brown
2023-08-03  9:10                   ` Sahin, Okan
2023-08-03 11:15                     ` Mark Brown
2023-08-03 11:33                       ` Sahin, Okan
2023-07-17 13:46 ` [PATCH v3 0/2] Add " Mark Brown

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=20230726161033.GA1102409@dev-arch.thelio-3990X \
    --to=nathan@kernel.org \
    --cc=Ibrahim.Tilki@analog.com \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=okan.sahin@analog.com \
    --cc=robh+dt@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).