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: <D9VV76MU61HW.XEELOHWXFW3Q@bootlin.com>
Date: Wed, 14 May 2025 13:59:11 +0200
From: "Mathieu Dubois-Briand" <mathieu.dubois-briand@...tlin.com>
To: "Mark Brown" <broonie@...nel.org>
Cc: "Lee Jones" <lee@...nel.org>, "Rob Herring" <robh@...nel.org>,
 "Krzysztof Kozlowski" <krzk+dt@...nel.org>, "Conor Dooley"
 <conor+dt@...nel.org>, "Kamel Bouhara" <kamel.bouhara@...tlin.com>, "Linus
 Walleij" <linus.walleij@...aro.org>, "Bartosz Golaszewski" <brgl@...ev.pl>,
 "Dmitry Torokhov" <dmitry.torokhov@...il.com>,
 Uwe Kleine-König <ukleinek@...nel.org>, "Michael Walle"
 <mwalle@...nel.org>, "Greg Kroah-Hartman" <gregkh@...uxfoundation.org>,
 "Rafael J. Wysocki" <rafael@...nel.org>, "Danilo Krummrich"
 <dakr@...nel.org>, <devicetree@...r.kernel.org>,
 <linux-kernel@...r.kernel.org>, <linux-gpio@...r.kernel.org>,
 <linux-input@...r.kernel.org>, <linux-pwm@...r.kernel.org>,
 <andriy.shevchenko@...el.com>, Grégory Clement
 <gregory.clement@...tlin.com>, "Thomas Petazzoni"
 <thomas.petazzoni@...tlin.com>, "Andy Shevchenko"
 <andriy.shevchenko@...ux.intel.com>
Subject: Re: [PATCH v8 05/11] regmap: irq: Add support for chips without
 separate IRQ status

On Wed May 14, 2025 at 11:59 AM CEST, Mark Brown wrote:
> On Fri, May 09, 2025 at 11:14:39AM +0200, Mathieu Dubois-Briand wrote:
>> Some GPIO chips allow to rise an IRQ on GPIO level changes but do not
>> provide an IRQ status for each separate line: only the current gpio
>> level can be retrieved.
>
> This doesn't build in a wide range of configurations (none at all
> AFAICT):
>
> /build/stage/linux/drivers/base/regmap/regmap-irq.c: In function ‘regmap_add_irq
> _chip_fwnode’:
> /build/stage/linux/drivers/base/regmap/regmap-irq.c:914:88: error: macro "array_
> size" requires 2 arguments, but only 1 given
>   914 |                 memcpy(d->prev_status_buf, d->status_buf, array_size(d->
> prev_status_buf));
>       |                                                                         
>                ^
> In file included from /build/stage/linux/include/linux/string.h:13,
>                  from /build/stage/linux/include/linux/bitmap.h:13,
>                  from /build/stage/linux/include/linux/cpumask.h:12,
>                  from /build/stage/linux/include/linux/smp.h:13,
>                  from /build/stage/linux/include/linux/lockdep.h:14,
>                  from /build/stage/linux/include/linux/spinlock.h:63,
>                  from /build/stage/linux/include/linux/sched.h:2213,
>                  from /build/stage/linux/include/linux/ratelimit.h:6,
>                  from /build/stage/linux/include/linux/dev_printk.h:16,
>                  from /build/stage/linux/include/linux/device.h:15,
>                  from /build/stage/linux/drivers/base/regmap/regmap-irq.c:10:
> /build/stage/linux/include/linux/overflow.h:327:9: note: macro "array_size" defined here
>   327 | #define array_size(a, b)        size_mul(a, b)
>       |         ^~~~~~~~~~
> /build/stage/linux/drivers/base/regmap/regmap-irq.c:914:59: error: ‘array_size’ undeclared (first use in this function)
>   914 |                 memcpy(d->prev_status_buf, d->status_buf, array_size(d->prev_status_buf));
>       |                                                           ^~~~~~~~~~
> /build/stage/linux/drivers/base/regmap/regmap-irq.c:914:59: note: each undeclared identifier is reported only once for each function it appears in

My bad, I somehow ended with this commit introducing bad code but having
the next patch of the series fixing it. I will take care of that. Thanks
for pointing this.

Thanks for your review.
Mathieu

-- 
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ