Re: [PATCH] Revert "i2c: core: Allocate temp client on the stack in i2c_detect"

From: Wolfram Sang
Date: Sat Feb 22 2025 - 04:33:14 EST


On Fri, Feb 21, 2025 at 09:54:40PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@xxxxxxxx>
>
> struct i2c_client is way too large to be put on the kernel stack, and depending
> on the kernel configuration, this can exceed the compile-time warning limit:
>
> drivers/i2c/i2c-core-base.c:1420:12: error: stack frame size (1040) exceeds limit (1024) in 'i2c_do_add_adapter' [-Werror,-Wframe-larger-than]
> 1420 | static int i2c_do_add_adapter(struct i2c_driver *driver,
> | ^
>
> The current version is the result of a cleanup patch that does not appear
> to be a requirement for anything else, so address the problem through a
> simple revert.
>
> Fixes: 735668f8e5c9 ("i2c: core: Allocate temp client on the stack in i2c_detect")
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>

Thank you, yet Geert was faster and fixed a checkpatch check:

https://lore.kernel.org/r/f9aa39362e918b62aec0567f899b37d8d3c44710.1740064176.git.geert+renesas@xxxxxxxxx

Attachment: signature.asc
Description: PGP signature