Re: [PATCH] powerpc: ps3: mark ps3_notification_device static for stack usage
From: Geoff Levand <geoff@infradead.org>
Date: 2024-03-24 01:19:25
Also in:
lkml, llvm
From: Geoff Levand <geoff@infradead.org>
Date: 2024-03-24 01:19:25
Also in:
lkml, llvm
On 3/23/24 05:24, Arnd Bergmann wrote:
On Fri, Mar 22, 2024, at 09:34, Geoff Levand wrote:quoted
On 3/21/24 17:32, Geert Uytterhoeven wrote:quoted
--- a/arch/powerpc/platforms/ps3/device-init.cquoted
+++ 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.I didn't think it mattered much, given that you would rarely have a kernel with PS3 support along with other platforms. I suppose it does increase the size for a PS3-only kernel as well, while your version makes it smaller.quoted
Here's what I came up with. It builds for me without warnings. I haven't tested it yet. A review would be appreciated.It seems a little complicated but looks all correct to me and reduces both stack and .data size, so Acked-by: Arnd Bergmann <arnd@arndb.de>
Thanks Arnd. I also thought it was a bit too much. I made a simpler version that I'll post as a separate message. -Geoff