[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DGAGGT76OPJK.3NJVOK7LZTKT7@disroot.org>
Date: Mon, 09 Feb 2026 18:42:19 +0530
From: "Kaustabh Chakraborty" <kauschluss@...root.org>
To: Łukasz Lebiedziński <kernel@...asz.us>, "Lee
Jones" <lee@...nel.org>
Cc: "Kaustabh Chakraborty" <kauschluss@...root.org>,
<linux-kernel@...r.kernel.org>, <linux-samsung-soc@...r.kernel.org>,
André Draszik <andre.draszik@...aro.org>
Subject: Re: [PATCH FIX] mfd: sec-irq: fix non-constant case labels in
s2mu005_irq_get_reg
On 2026-02-09 05:03 +01:00, Łukasz Lebiedziński wrote:
> Case labels must be compile-time constants, 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
This was already reported by lkp bot, and I have fixed it locally
already. Weirdly, I don't get this error somehow.
>
> 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].
>
> 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@...asz.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:
We're checking the base register here, so all other than the first one
is redundant.
> 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];
> }
>
Powered by blists - more mailing lists