]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
scsi: buslogic: Reduce stack usage
authorArnd Bergmann <arnd@arndb.de>
Tue, 3 Feb 2026 16:33:15 +0000 (17:33 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 4 Feb 2026 03:31:13 +0000 (22:31 -0500)
commite17f0d4cc006265dd92129db4bf9da3a2e4a4f66
treedf26afed697bef59842cd46c847d52eba88dd7f0
parentbbb8d98fb4536594cb104fd630ea0f7dce3771d6
scsi: buslogic: Reduce stack usage

Some randconfig builds run into excessive stack usage with gcc-14 or
higher, which use __attribute__((cold)) where earlier versions did not do
that:

drivers/scsi/BusLogic.c: In function 'blogic_init':
drivers/scsi/BusLogic.c:2398:1: error: the frame size of 1680 bytes is larger than 1536 bytes [-Werror=frame-larger-than=]

The problem is that a lot of code gets inlined into blogic_init() here. Two
functions stick out, but they are a bit different:

 - blogic_init_probeinfo_list() actually uses a few hundred bytes of kernel
   stack, which is a problem in combination with other functions that also
   do. Marking this one as noinline means that the stack slots get get
   reused between function calls

 - blogic_reportconfig() has a few large variables, but whenever it is not
   inlined into its caller, the compiler is actually smart enough to reuse
   stack slots for these automatically, so marking it as noinline saves
   most of the stack space by itself.

The combination of both of these should avoid the problem entirely.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patch.msgid.link/20260203163321.2598593-1-arnd@kernel.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/BusLogic.c