|
From: openocd-gerrit <ope...@us...> - 2023-05-05 22:14:57
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via d771d7f1a7d0181b4670c7c3ddb83ba8b8eb7da0 (commit)
from 4b7dc557386a7482e8d77b59f543b9a0ef7cae4f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit d771d7f1a7d0181b4670c7c3ddb83ba8b8eb7da0
Author: Antonio Borneo <bor...@gm...>
Date: Sun Apr 9 01:40:51 2023 +0200
target: with pointers, use NULL instead of 0
Don't assign pointer to 0, use NULL.
Don't pass 0 ad pointer argument, pass NULL.
Detected through 'sparse' tool.
Change-Id: I806031d2ae505fa5f0accc6be1936d48cd365ca4
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7604
Tested-by: jenkins
diff --git a/src/target/arm9tdmi.c b/src/target/arm9tdmi.c
index 805330f25..3bacfaefd 100644
--- a/src/target/arm9tdmi.c
+++ b/src/target/arm9tdmi.c
@@ -57,7 +57,7 @@ static const struct arm9tdmi_vector {
{"dabt", ARM9TDMI_DABT_VECTOR},
{"irq", ARM9TDMI_IRQ_VECTOR},
{"fiq", ARM9TDMI_FIQ_VECTOR},
- {0, 0},
+ {NULL, 0},
};
int arm9tdmi_examine_debug_reason(struct target *target)
diff --git a/src/target/armv8_dpm.c b/src/target/armv8_dpm.c
index fcd4d5971..d1eefe5b3 100644
--- a/src/target/armv8_dpm.c
+++ b/src/target/armv8_dpm.c
@@ -274,7 +274,7 @@ static int dpmv8_instr_write_data_dcc(struct arm_dpm *dpm,
if (retval != ERROR_OK)
return retval;
- return dpmv8_exec_opcode(dpm, opcode, 0);
+ return dpmv8_exec_opcode(dpm, opcode, NULL);
}
static int dpmv8_instr_write_data_dcc_64(struct arm_dpm *dpm,
@@ -287,7 +287,7 @@ static int dpmv8_instr_write_data_dcc_64(struct arm_dpm *dpm,
if (retval != ERROR_OK)
return retval;
- return dpmv8_exec_opcode(dpm, opcode, 0);
+ return dpmv8_exec_opcode(dpm, opcode, NULL);
}
static int dpmv8_instr_write_data_r0(struct arm_dpm *dpm,
diff --git a/src/target/dsp563xx_once.c b/src/target/dsp563xx_once.c
index 22445067a..866f33152 100644
--- a/src/target/dsp563xx_once.c
+++ b/src/target/dsp563xx_once.c
@@ -60,7 +60,7 @@ static inline int dsp563xx_once_ir_exec(struct jtag_tap *tap, int flush, uint8_t
{
int err;
- err = dsp563xx_write_dr_u8(tap, 0, instr | (ex << 5) | (go << 6) | (rw << 7), 8, 0);
+ err = dsp563xx_write_dr_u8(tap, NULL, instr | (ex << 5) | (go << 6) | (rw << 7), 8, 0);
if (err != ERROR_OK)
return err;
if (flush)
@@ -226,7 +226,7 @@ int dsp563xx_once_reg_write(struct jtag_tap *tap, int flush, uint8_t reg, uint32
err = dsp563xx_once_ir_exec(tap, flush, reg, 0, 0, 0);
if (err != ERROR_OK)
return err;
- err = dsp563xx_write_dr_u32(tap, 0x00, data, 24, 0);
+ err = dsp563xx_write_dr_u32(tap, NULL, data, 24, 0);
if (err != ERROR_OK)
return err;
if (flush)
@@ -242,7 +242,7 @@ int dsp563xx_once_execute_sw_ir(struct jtag_tap *tap, int flush, uint32_t opcode
err = dsp563xx_once_ir_exec(tap, flush, DSP563XX_ONCE_OPDBR, 0, 1, 0);
if (err != ERROR_OK)
return err;
- err = dsp563xx_write_dr_u32(tap, 0, opcode, 24, 0);
+ err = dsp563xx_write_dr_u32(tap, NULL, opcode, 24, 0);
if (err != ERROR_OK)
return err;
if (flush)
@@ -258,7 +258,7 @@ int dsp563xx_once_execute_dw_ir(struct jtag_tap *tap, int flush, uint32_t opcode
err = dsp563xx_once_ir_exec(tap, flush, DSP563XX_ONCE_OPDBR, 0, 0, 0);
if (err != ERROR_OK)
return err;
- err = dsp563xx_write_dr_u32(tap, 0, opcode, 24, 0);
+ err = dsp563xx_write_dr_u32(tap, NULL, opcode, 24, 0);
if (err != ERROR_OK)
return err;
if (flush) {
@@ -270,7 +270,7 @@ int dsp563xx_once_execute_dw_ir(struct jtag_tap *tap, int flush, uint32_t opcode
err = dsp563xx_once_ir_exec(tap, flush, DSP563XX_ONCE_OPDBR, 0, 1, 0);
if (err != ERROR_OK)
return err;
- err = dsp563xx_write_dr_u32(tap, 0, operand, 24, 0);
+ err = dsp563xx_write_dr_u32(tap, NULL, operand, 24, 0);
if (err != ERROR_OK)
return err;
if (flush) {
diff --git a/src/target/xtensa/xtensa.c b/src/target/xtensa/xtensa.c
index fcd00487c..63ffefce7 100644
--- a/src/target/xtensa/xtensa.c
+++ b/src/target/xtensa/xtensa.c
@@ -410,7 +410,7 @@ static int xtensa_core_reg_get(struct reg *reg)
return ERROR_TARGET_NOT_HALTED;
if (!reg->exist) {
if (strncmp(reg->name, "?0x", 3) == 0) {
- unsigned int regnum = strtoul(reg->name + 1, 0, 0);
+ unsigned int regnum = strtoul(reg->name + 1, NULL, 0);
LOG_WARNING("Read unknown register 0x%04x ignored", regnum);
return ERROR_OK;
}
@@ -430,7 +430,7 @@ static int xtensa_core_reg_set(struct reg *reg, uint8_t *buf)
if (!reg->exist) {
if (strncmp(reg->name, "?0x", 3) == 0) {
- unsigned int regnum = strtoul(reg->name + 1, 0, 0);
+ unsigned int regnum = strtoul(reg->name + 1, NULL, 0);
LOG_WARNING("Write unknown register 0x%04x ignored", regnum);
return ERROR_OK;
}
-----------------------------------------------------------------------
Summary of changes:
src/target/arm9tdmi.c | 2 +-
src/target/armv8_dpm.c | 4 ++--
src/target/dsp563xx_once.c | 10 +++++-----
src/target/xtensa/xtensa.c | 4 ++--
4 files changed, 10 insertions(+), 10 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|