public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Laight <david.laight.linux@gmail.com>
To: "Łukasz Lebiedziński" <kernel@lvkasz.us>
Cc: "Lee Jones" <lee@kernel.org>,
	"Kaustabh Chakraborty" <kauschluss@disroot.org>,
	linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
	"André Draszik" <andre.draszik@linaro.org>
Subject: Re: [PATCH FIX] mfd: sec-irq: fix non-constant case labels in s2mu005_irq_get_reg
Date: Mon, 9 Feb 2026 09:56:11 +0000	[thread overview]
Message-ID: <20260209095611.12e4d438@pumpkin> (raw)
In-Reply-To: <20260209040358.2123413-1-kernel@lvkasz.us>

On Mon,  9 Feb 2026 05:03:58 +0100
Łukasz Lebiedziński <kernel@lvkasz.us> wrote:

> Case labels must be compile-time constants,

They must be 'integer constant expressions' which it stronger than
'compile time constant'.

> but the original
> implementation used array element values like irqf_regs[0], causing
> a compilation error:
> 
>   drivers/mfd/sec-irq.c:218:9: error: case label does not reduce to
>   an integer constant
> 
> Replace array-based case labels with explicit S2MU005_REG_* defines
> for all four interrupt status and mask registers, preserving the
> original logic.
> 
> This addresses an issue in the S2MU005 PMIC support patches [1].

Makes one wonder how the patches were tested.

> 
> Link: https://lore.kernel.org/all/20260126-s2mu005-pmic-v2-6-78f1a75f547a@disroot.org/#Z31drivers:mfd:sec-irq.c [1]
> Signed-off-by: Łukasz Lebiedziński <kernel@lvkasz.us>
> ---
>  drivers/mfd/sec-irq.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mfd/sec-irq.c b/drivers/mfd/sec-irq.c
> index 44a1eb074a08..73a611ba0502 100644
> --- a/drivers/mfd/sec-irq.c
> +++ b/drivers/mfd/sec-irq.c
> @@ -215,9 +215,15 @@ static unsigned int s2mu005_irq_get_reg(struct regmap_irq_chip_data *data,
>  	};
>  
>  	switch (base) {
> -	case irqf_regs[0]:
> +	case S2MU005_REG_CHGR_INT1:
> +	case S2MU005_REG_FLED_INT1:
> +	case S2MU005_REG_MUIC_INT1:
> +	case S2MU005_REG_MUIC_INT2:
>  		return irqf_regs[index];
> -	case mask_regs[0]:
> +	case S2MU005_REG_CHGR_INT1M:
> +	case S2MU005_REG_FLED_INT1M:
> +	case S2MU005_REG_MUIC_INT1M:
> +	case S2MU005_REG_MUIC_INT2M:
>  		return mask_regs[index];
>  	}

That looks as though it ought to be an if statement (or two).

	David

>  


  reply	other threads:[~2026-02-09  9:56 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-25 19:07 [PATCH v2 00/12] Support for Samsung S2MU005 PMIC and its sub-devices Kaustabh Chakraborty
2026-01-25 19:07 ` [PATCH v2 01/12] dt-bindings: leds: document Samsung S2M series PMIC flash LED device Kaustabh Chakraborty
2026-01-25 19:07 ` [PATCH v2 02/12] dt-bindings: leds: document Samsung S2M series PMIC RGB " Kaustabh Chakraborty
2026-02-06 13:38   ` Rob Herring
2026-02-06 13:56     ` Kaustabh Chakraborty
2026-02-06 14:03       ` Kaustabh Chakraborty
2026-02-08 13:05       ` Jacek Anaszewski
2026-01-25 19:07 ` [PATCH v2 03/12] dt-bindings: extcon: document Samsung S2M series PMIC extcon device Kaustabh Chakraborty
2026-02-06 13:49   ` Rob Herring
2026-02-06 13:52     ` Kaustabh Chakraborty
2026-01-25 19:07 ` [PATCH v2 04/12] dt-bindings: power: supply: document Samsung S2M series PMIC charger device Kaustabh Chakraborty
2026-01-25 19:07 ` [PATCH v2 05/12] dt-bindings: mfd: s2mps11: add documentation for S2MU005 PMIC Kaustabh Chakraborty
2026-01-25 20:59   ` Rob Herring (Arm)
2026-01-25 19:07 ` [PATCH v2 06/12] mfd: sec: add support " Kaustabh Chakraborty
2026-01-26 19:41   ` kernel test robot
2026-02-04 15:23   ` André Draszik
2026-02-05 15:32     ` Kaustabh Chakraborty
2026-02-10  9:55       ` André Draszik
2026-02-20 16:56       ` Sander Vanheule
2026-02-23 13:56         ` Kaustabh Chakraborty
2026-02-09  4:03   ` [PATCH FIX] mfd: sec-irq: fix non-constant case labels in s2mu005_irq_get_reg Łukasz Lebiedziński
2026-02-09  9:56     ` David Laight [this message]
2026-02-09 13:12     ` Kaustabh Chakraborty
2026-01-25 19:07 ` [PATCH v2 07/12] mfd: sec: store hardware revision in sec_pmic_dev and add S2MU005 support Kaustabh Chakraborty
2026-02-04 14:17   ` André Draszik
2026-02-04 15:05     ` Kaustabh Chakraborty
2026-02-05 16:26       ` Kaustabh Chakraborty
2026-01-25 19:07 ` [PATCH v2 08/12] leds: flash: add support for Samsung S2M series PMIC flash LED device Kaustabh Chakraborty
2026-02-04 16:55   ` André Draszik
2026-02-05 16:16     ` Kaustabh Chakraborty
2026-02-10 10:03       ` André Draszik
2026-02-10 18:37         ` Kaustabh Chakraborty
2026-02-05 10:54   ` André Draszik
2026-01-25 19:07 ` [PATCH v2 09/12] leds: rgb: add support for Samsung S2M series PMIC RGB " Kaustabh Chakraborty
2026-01-25 19:07 ` [PATCH v2 10/12] Documentation: leds: document pattern behavior of Samsung S2M series PMIC RGB LEDs Kaustabh Chakraborty
2026-01-25 19:07 ` [PATCH v2 11/12] extcon: add support for Samsung S2M series PMIC extcon devices Kaustabh Chakraborty
2026-01-25 19:07 ` [PATCH v2 12/12] power: supply: add support for Samsung S2M series PMIC charger device Kaustabh Chakraborty

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=20260209095611.12e4d438@pumpkin \
    --to=david.laight.linux@gmail.com \
    --cc=andre.draszik@linaro.org \
    --cc=kauschluss@disroot.org \
    --cc=kernel@lvkasz.us \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.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