linux/drivers/cxl/core
Nathan Chancellor be185c2988 cxl/core: Remove cxld_const_init in cxl_decoder_alloc()
Commit 48667f6761 ("cxl/core: Split decoder setup into alloc + add")
aimed to fix a large stack frame warning but from v5 to v6, it
introduced a new instance of the warning due to allocating
cxld_const_init on the stack, which was done due to the use of const on
the nr_target member of the cxl_decoder struct. With ARCH=arm
allmodconfig minus CONFIG_KASAN:

GCC 11.2.0:

drivers/cxl/core/bus.c: In function ‘cxl_decoder_alloc’:
drivers/cxl/core/bus.c:523:1: error: the frame size of 1032 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
  523 | }
      | ^
cc1: all warnings being treated as errors

Clang 12.0.1:

drivers/cxl/core/bus.c:486:21: error: stack frame size of 1056 bytes in function 'cxl_decoder_alloc' [-Werror,-Wframe-larger-than=]
struct cxl_decoder *cxl_decoder_alloc(struct cxl_port *port, int nr_targets)
                    ^
1 error generated.

Revert that part of the change, which makes the stack frame of
cxl_decoder_alloc() much more reasonable.

Fixes: 48667f6761 ("cxl/core: Split decoder setup into alloc + add")
Link: https://github.com/ClangBuiltLinux/linux/issues/1539
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20211210213627.2477370-1-nathan@kernel.org
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2022-01-04 17:29:31 -08:00
..
bus.c cxl/core: Remove cxld_const_init in cxl_decoder_alloc() 2022-01-04 17:29:31 -08:00
core.h cxl/core: Split decoder setup into alloc + add 2021-09-21 14:09:34 -07:00
Makefile cxl/core: Convert to EXPORT_SYMBOL_NS_GPL 2021-11-15 11:02:59 -08:00
mbox.c cxl/core: Convert to EXPORT_SYMBOL_NS_GPL 2021-11-15 11:02:59 -08:00
memdev.c cxl/core: Convert to EXPORT_SYMBOL_NS_GPL 2021-11-15 11:02:59 -08:00
pmem.c cxl/pmem: Fix module reload vs workqueue state 2021-11-15 11:03:00 -08:00
regs.c cxl/core: Convert to EXPORT_SYMBOL_NS_GPL 2021-11-15 11:02:59 -08:00