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
@@ -298,7 +298,7 @@ static int arc_jtag_read_registers(struct arc_jtag *jtag_info, uint32_t type,
|
||||
ARC_JTAG_READ_FROM_CORE_REG : ARC_JTAG_READ_FROM_AUX_REG);
|
||||
arc_jtag_enque_set_transaction(jtag_info, transaction, TAP_DRPAUSE);
|
||||
|
||||
uint8_t *data_buf = calloc(sizeof(uint8_t), count * 4);
|
||||
uint8_t *data_buf = calloc(count * 4, sizeof(uint8_t));
|
||||
|
||||
arc_jtag_enque_register_rw(jtag_info, addr, data_buf, NULL, count);
|
||||
|
||||
@@ -498,7 +498,7 @@ int arc_jtag_read_memory(struct arc_jtag *jtag_info, uint32_t addr,
|
||||
if (!count)
|
||||
return ERROR_OK;
|
||||
|
||||
data_buf = calloc(sizeof(uint8_t), count * 4);
|
||||
data_buf = calloc(count * 4, sizeof(uint8_t));
|
||||
arc_jtag_enque_reset_transaction(jtag_info);
|
||||
|
||||
/* We are reading from memory. */
|
||||
|
||||
Reference in New Issue
Block a user