flash/nor/max32: fix: call to calloc

With gcc 15.2.1 we get the following error:
'calloc' sizes specified with 'sizeof' in the earlier argument and
not in the later argument.

Change-Id: Ib34d758bc09d34d86d29dd02ea9c7f05b1e83327
Signed-off-by: Daniel Anselmi <danselmi@gmx.ch>
Reviewed-on: https://review.openocd.org/c/openocd/+/9014
Reviewed-by: zapb <dev@zapb.de>
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
Daniel Anselmi
2025-08-18 23:17:09 +02:00
committed by Antonio Borneo
parent f381945567
commit 56d67dac2e

View File

@@ -113,7 +113,7 @@ FLASH_BANK_COMMAND_HANDLER(max32xxx_flash_bank_command)
return ERROR_FLASH_BANK_INVALID;
}
info = calloc(sizeof(struct max32xxx_flash_bank), 1);
info = calloc(1, sizeof(struct max32xxx_flash_bank));
COMMAND_PARSE_NUMBER(u32, CMD_ARGV[2], info->flash_size);
COMMAND_PARSE_NUMBER(u32, CMD_ARGV[6], info->flc_base);
COMMAND_PARSE_NUMBER(u32, CMD_ARGV[7], info->sector_size);