Thread (10 messages) 10 messages, 5 authors, 2024-04-22

Re: [PATCH] powerpc: ps3: mark ps3_notification_device static for stack usage

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2024-03-21 08:32:48
Also in: lkml, llvm

Hi Arnd,

On Wed, Mar 20, 2024 at 7:03 PM Arnd Bergmann [off-list ref] wrote:
From: Arnd Bergmann <arnd@arndb.de>

The device is way too large to be on the stack, causing a warning for
an allmodconfig build with clang:

arch/powerpc/platforms/ps3/device-init.c:771:12: error: stack frame size (2064) exceeds limit (2048) in 'ps3_probe_thread' [-Werror,-Wframe-larger-than]
  771 | static int ps3_probe_thread(void *data)

There is only a single thread that ever accesses this, so it's fine to
make it static, which avoids the warning.

Fixes: b4cb2941f855 ("[POWERPC] PS3: Use the HVs storage device notification mechanism properly")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Thanks for your patch!
quoted hunk ↗ jump to hunk
--- a/arch/powerpc/platforms/ps3/device-init.c
+++ b/arch/powerpc/platforms/ps3/device-init.c
@@ -770,7 +770,7 @@ static struct task_struct *probe_task;

 static int ps3_probe_thread(void *data)
 {
-       struct ps3_notification_device dev;
+       static struct ps3_notification_device dev;
        int res;
        unsigned int irq;
        u64 lpar;
Making it static increases kernel size for everyone.  So I'd rather
allocate it dynamically. The thread already allocates a buffer, which
can be replaced at no cost by allocating a structure containing both
the ps3_notification_device and the buffer.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help