Elyes Haouas has submitted this change. ( https://review.coreboot.org/c/coreboot/+/82786?usp=email )
Change subject: tree: Use calloc(n, sizeof(struct)) insteadof calloc(sizeof(struct), n) ......................................................................
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 --- M src/soc/intel/common/block/irq/irq.c M src/southbridge/intel/common/rcba_pirq.c 2 files changed, 2 insertions(+), 2 deletions(-)
Approvals: Nico Huber: Looks good to me, approved build bot (Jenkins): Verified
diff --git a/src/soc/intel/common/block/irq/irq.c b/src/soc/intel/common/block/irq/irq.c index 4ffe138..386538e 100644 --- a/src/soc/intel/common/block/irq/irq.c +++ b/src/soc/intel/common/block/irq/irq.c @@ -373,7 +373,7 @@ 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); diff --git a/src/southbridge/intel/common/rcba_pirq.c b/src/southbridge/intel/common/rcba_pirq.c index c9ab140..956fe63 100644 --- a/src/southbridge/intel/common/rcba_pirq.c +++ b/src/southbridge/intel/common/rcba_pirq.c @@ -59,7 +59,7 @@
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]),