fix GCC's -Wcalloc-transposed-args warning
GCC 14.1.0 warns about calls to `calloc()` with element size as the first argument. Link: https://gcc.gnu.org/onlinedocs/gcc-14.1.0/gcc/Warning-Options.html#index-Wcalloc-transposed-args Change-Id: I7d44a74a003ee6ec49d165f91727972478214587 Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8301 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
This commit is contained in:
committed by
Antonio Borneo
parent
e4c0904731
commit
400cf213c0
@@ -930,7 +930,7 @@ FLASH_BANK_COMMAND_HANDLER(kinetis_flash_bank_command)
|
||||
k_chip = kinetis_get_chip(target);
|
||||
|
||||
if (!k_chip) {
|
||||
k_chip = calloc(sizeof(struct kinetis_chip), 1);
|
||||
k_chip = calloc(1, sizeof(struct kinetis_chip));
|
||||
if (!k_chip) {
|
||||
LOG_ERROR("No memory");
|
||||
return ERROR_FAIL;
|
||||
@@ -1031,7 +1031,7 @@ static int kinetis_create_missing_banks(struct kinetis_chip *k_chip)
|
||||
bank_idx - k_chip->num_pflash_blocks);
|
||||
}
|
||||
|
||||
bank = calloc(sizeof(struct flash_bank), 1);
|
||||
bank = calloc(1, sizeof(struct flash_bank));
|
||||
if (!bank)
|
||||
return ERROR_FAIL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user