Attention is currently required from: Tim Wawrzynczak.
Elyes Haouas has posted comments on this change by Tim Wawrzynczak. ( https://review.coreboot.org/c/coreboot/+/50857?usp=email )
Change subject: sb/intel/common: Refactor _PRT generation to support GSI-based tables ......................................................................
Patch Set 22:
(1 comment)
File src/southbridge/intel/common/rcba_pirq.c:
https://review.coreboot.org/c/coreboot/+/50857/comment/fadcaa30_18eda31a?usp... : PS22, Line 61: pin_irq_map = calloc(sizeof(struct slot_pin_irq_map), MAX_SLOTS * PCI_INT_MAX);
They're equivalent
The two calloc calls are not equivalent indeed. The first call, calloc(sizeof(struct slot_pin_irq_map), MAX_SLOTS * PCI_INT_MAX), allocates memory for sizeof(struct slot_pin_irq_map) elements, each of size MAX_SLOTS * PCI_INT_MAX bytes. In contrast, the second call, calloc(MAX_SLOTS, sizeof(struct slot_pin_irq_map) * PCI_INT_MAX), allocates memory for MAX_SLOTS elements, each of size sizeof(struct slot_pin_irq_map) * PCI_INT_MAX bytes. Although the total amount of memory allocated is mathematically the same, the second call correctly follows the calloc convention by specifying the number of elements and the size of each element, making it the appropriate and intuitive choice.
(see https://review.coreboot.org/c/coreboot/+/82658)