lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260209095611.12e4d438@pumpkin>
Date: Mon, 9 Feb 2026 09:56:11 +0000
From: David Laight <david.laight.linux@...il.com>
To: Łukasz Lebiedziński <kernel@...asz.us>
Cc: Lee Jones <lee@...nel.org>, 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 Mon,  9 Feb 2026 05:03:58 +0100
Łukasz Lebiedziński <kernel@...asz.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@...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:
>  		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

>  


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ