Re: [PATCH] iio: osf: avoid a large stack frame in osf_core_init
From: Joshua Crofts
Date: Tue Oct 20 2026 - 03:54:41 EST
On Mon, 19 Oct 2026 18:58:49 +0900
Jinseob Kim <kimjinseob88@xxxxxxxxx> wrote:
> Clang reports a 1344-byte stack frame in osf_core_init() for
> hexagon-allmodconfig, exceeding CONFIG_FRAME_WARN=1280.
>
> The aggregate assignment materializes a temporary struct osf_device on
> the stack and copies it to the destination. With the mutex and caches
> added by the IIO support, this structure is 1328 bytes in the reported
> configuration.
>
> Clear the destination directly, then set dev and initialize latest_lock
> as before. This preserves zero initialization of all other fields,
> including when the core is reinitialized for a new session, without the
> large temporary object.
>
> With the reported Clang 24.0.0git compiler and Hexagon configuration, the
> frame decreases from 1344 to 8 bytes and the warning disappears.
>
> Fixes: 7329986669f2 ("iio: osf: add IIO devices from capability reports")
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Closes: https://lore.kernel.org/oe-kbuild-all/202610191514.fRYyu0HX-lkp@xxxxxxxxx/
> Assisted-by: LLM
> Signed-off-by: Jinseob Kim <kimjinseob88@xxxxxxxxx>
> ---
Reviewed-by: Joshua Crofts <joshua.crofts1@xxxxxxxxx>
--
Kind regards,
Joshua Crofts