Centos-kernel-stream-9/drivers/cxl
John W. Linville f1369c95b7 cxl/core: Remove cxld_const_init in cxl_decoder_alloc()
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2072584

Commit 48667f676189 ("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: 48667f676189 ("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>
(cherry picked from commit be185c2988b48db65348d94168c793bdbc8d23c3)
Signed-off-by: John W. Linville <linville@redhat.com>
2022-04-08 11:22:29 -04:00
..
core cxl/core: Remove cxld_const_init in cxl_decoder_alloc() 2022-04-08 11:22:29 -04:00
Kconfig cxl/pmem: Add initial infrastructure for pmem support 2021-06-15 16:47:14 -07:00
Makefile cxl: Move cxl_core to new directory 2022-03-21 10:44:09 -04:00
acpi.c cxl/acpi: Do not fail cxl_acpi_probe() based on a missing CHBS 2022-04-08 11:22:28 -04:00
cxl.h cxl/core: Remove cxld_const_init in cxl_decoder_alloc() 2022-04-08 11:22:29 -04:00
cxlmem.h cxl/memdev: Remove unused cxlmd field 2022-04-08 11:22:29 -04:00
pci.c cxl/memdev: Change cxl_mem to a more descriptive name 2022-04-08 11:22:29 -04:00
pci.h cxl/pci: Convert register block identifiers to an enum 2022-04-08 11:22:28 -04:00
pmem.c cxl/pmem: Fix module reload vs workqueue state 2022-04-08 11:22:29 -04:00