tree: Use Wcalloc-transposed-args command option
GCC-14 documentation says "The first argument to calloc is documented to be number of elements in array, while the second argument is size of each element, so calloc(n, sizeof (int)) is preferred over calloc(sizeof(int), n)." Change-Id: I77b6f4d2eda487b087ba5665b588999633c33e8d Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/c/coreboot/+/82658 Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
committed by
Felix Singer
parent
877fafab57
commit
b3db3abd63
@@ -502,6 +502,7 @@ CFLAGS_common += -fstrict-aliasing -ffunction-sections -fdata-sections -fno-pie
|
||||
CFLAGS_common += -Wstring-compare
|
||||
ifeq ($(CONFIG_COMPILER_GCC),y)
|
||||
CFLAGS_common += -Wold-style-declaration -Wflex-array-member-not-at-end
|
||||
CFLAGS_common += -Wcalloc-transposed-args
|
||||
# Don't add these GCC specific flags when running scan-build
|
||||
ifeq ($(CCC_ANALYZER_OUTPUT_FORMAT),)
|
||||
CFLAGS_common += -Wno-packed-not-aligned
|
||||
|
@@ -58,7 +58,7 @@ void intel_acpi_gen_def_acpi_pirq(const struct device *lpc)
|
||||
|
||||
printk(BIOS_DEBUG, "Generating ACPI PIRQ entries\n");
|
||||
|
||||
pin_irq_map = calloc(sizeof(struct slot_pin_irq_map), MAX_SLOTS * PCI_INT_MAX);
|
||||
pin_irq_map = calloc(MAX_SLOTS * PCI_INT_MAX, sizeof(struct slot_pin_irq_map));
|
||||
pirq_map.type = PIRQ_SOURCE_PATH;
|
||||
for (i = 0; i < PIRQ_COUNT; i++)
|
||||
snprintf(pirq_map.source_path[i], sizeof(pirq_map.source_path[i]),
|
||||
|
Reference in New Issue
Block a user