tree: Use calloc(n, sizeof(struct)) insteadof calloc(sizeof(struct), n)

Change-Id: I5e67e370d4eb8fe28227843bbca34db06ad84b26
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82786
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Elyes Haouas 2024-06-03 17:00:56 +02:00
parent ea7a83ee88
commit 178a5054b3
2 changed files with 2 additions and 2 deletions

View File

@ -373,7 +373,7 @@ bool generate_pin_irq_map(void)
if (!cached_entries)
return false;
pin_irq_map = calloc(MAX_SLOTS, sizeof(struct slot_pin_irq_map) * PCI_INT_MAX);
pin_irq_map = calloc(MAX_SLOTS * PCI_INT_MAX, sizeof(struct slot_pin_irq_map));
pirq_map.type = PIRQ_GSI;
legacy_pirq_routing = lpc_get_pic_pirq_routing(&pirq_routes);

View File

@ -59,7 +59,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]),