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 <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7604 Tested-by: jenkins
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user