Avoid non-standard conditionals with omitted operands.
Fixes bug #257. Change-Id: I05fc6468306d46399e769098e031e7e588798afc Signed-off-by: R. Diez <rdiezmail-openocd@yahoo.de> Reviewed-on: http://openocd.zylin.com/6271 Tested-by: jenkins Reviewed-by: Xiang W <wxjstz@126.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
parent
358ab3483d
commit
6a49b1ce23
|
@ -139,9 +139,9 @@ static int lpc3180_init(struct nand_device *nand)
|
||||||
{
|
{
|
||||||
struct lpc3180_nand_controller *lpc3180_info = nand->controller_priv;
|
struct lpc3180_nand_controller *lpc3180_info = nand->controller_priv;
|
||||||
struct target *target = nand->target;
|
struct target *target = nand->target;
|
||||||
int bus_width = nand->bus_width ? : 8;
|
int bus_width = nand->bus_width ? nand->bus_width : 8;
|
||||||
int address_cycles = nand->address_cycles ? : 3;
|
int address_cycles = nand->address_cycles ? nand->address_cycles : 3;
|
||||||
int page_size = nand->page_size ? : 512;
|
int page_size = nand->page_size ? nand->page_size : 512;
|
||||||
|
|
||||||
if (target->state != TARGET_HALTED) {
|
if (target->state != TARGET_HALTED) {
|
||||||
LOG_ERROR("target must be halted to use LPC3180 NAND flash controller");
|
LOG_ERROR("target must be halted to use LPC3180 NAND flash controller");
|
||||||
|
|
|
@ -191,9 +191,9 @@ static int lpc32xx_init(struct nand_device *nand)
|
||||||
{
|
{
|
||||||
struct lpc32xx_nand_controller *lpc32xx_info = nand->controller_priv;
|
struct lpc32xx_nand_controller *lpc32xx_info = nand->controller_priv;
|
||||||
struct target *target = nand->target;
|
struct target *target = nand->target;
|
||||||
int bus_width = nand->bus_width ? : 8;
|
int bus_width = nand->bus_width ? nand->bus_width : 8;
|
||||||
int address_cycles = nand->address_cycles ? : 3;
|
int address_cycles = nand->address_cycles ? nand->address_cycles : 3;
|
||||||
int page_size = nand->page_size ? : 512;
|
int page_size = nand->page_size ? nand->page_size : 512;
|
||||||
int retval;
|
int retval;
|
||||||
|
|
||||||
if (target->state != TARGET_HALTED) {
|
if (target->state != TARGET_HALTED) {
|
||||||
|
|
|
@ -183,7 +183,7 @@ static int nuc910_nand_init(struct nand_device *nand)
|
||||||
{
|
{
|
||||||
struct nuc910_nand_controller *nuc910_nand = nand->controller_priv;
|
struct nuc910_nand_controller *nuc910_nand = nand->controller_priv;
|
||||||
struct target *target = nand->target;
|
struct target *target = nand->target;
|
||||||
int bus_width = nand->bus_width ? : 8;
|
int bus_width = nand->bus_width ? nand->bus_width : 8;
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
result = validate_target_state(nand);
|
result = validate_target_state(nand);
|
||||||
|
|
|
@ -866,9 +866,9 @@ static COMMAND_HELPER(command_help_show, struct help_entry *c,
|
||||||
stage_msg = " (?mode error?)";
|
stage_msg = " (?mode error?)";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
msg = alloc_printf("%s%s", c->help ? : "", stage_msg);
|
msg = alloc_printf("%s%s", c->help ? c->help : "", stage_msg);
|
||||||
} else
|
} else
|
||||||
msg = alloc_printf("%s", c->help ? : "");
|
msg = alloc_printf("%s", c->help ? c->help : "");
|
||||||
|
|
||||||
if (NULL != msg) {
|
if (NULL != msg) {
|
||||||
command_help_show_wrap(msg, n + 3, n + 3);
|
command_help_show_wrap(msg, n + 3, n + 3);
|
||||||
|
|
|
@ -62,7 +62,7 @@ static int jim_adapter_name(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
|
||||||
return JIM_ERR;
|
return JIM_ERR;
|
||||||
}
|
}
|
||||||
const char *name = adapter_driver ? adapter_driver->name : NULL;
|
const char *name = adapter_driver ? adapter_driver->name : NULL;
|
||||||
Jim_SetResultString(goi.interp, name ? : "undefined", -1);
|
Jim_SetResultString(goi.interp, name ? name : "undefined", -1);
|
||||||
return JIM_OK;
|
return JIM_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1455,7 +1455,7 @@ void jtag_tap_init(struct jtag_tap *tap)
|
||||||
unsigned ir_len_bytes;
|
unsigned ir_len_bytes;
|
||||||
|
|
||||||
/* if we're autoprobing, cope with potentially huge ir_length */
|
/* if we're autoprobing, cope with potentially huge ir_length */
|
||||||
ir_len_bits = tap->ir_length ? : JTAG_IRLEN_MAX;
|
ir_len_bits = tap->ir_length ? tap->ir_length : JTAG_IRLEN_MAX;
|
||||||
ir_len_bytes = DIV_ROUND_UP(ir_len_bits, 8);
|
ir_len_bytes = DIV_ROUND_UP(ir_len_bits, 8);
|
||||||
|
|
||||||
tap->expected = calloc(1, ir_len_bytes);
|
tap->expected = calloc(1, ir_len_bytes);
|
||||||
|
|
|
@ -3904,7 +3904,7 @@ static int stlink_dap_op_queue_dp_read(struct adiv5_dap *dap, unsigned reg,
|
||||||
if (retval != ERROR_OK)
|
if (retval != ERROR_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
data = data ? : &dummy;
|
data = data ? data : &dummy;
|
||||||
if (stlink_dap_handle->version.flags & STLINK_F_QUIRK_JTAG_DP_READ
|
if (stlink_dap_handle->version.flags & STLINK_F_QUIRK_JTAG_DP_READ
|
||||||
&& stlink_dap_handle->st_mode == STLINK_MODE_DEBUG_JTAG) {
|
&& stlink_dap_handle->st_mode == STLINK_MODE_DEBUG_JTAG) {
|
||||||
/* Quirk required in JTAG. Read RDBUFF to get the data */
|
/* Quirk required in JTAG. Read RDBUFF to get the data */
|
||||||
|
@ -3969,7 +3969,7 @@ static int stlink_dap_op_queue_ap_read(struct adiv5_ap *ap, unsigned reg,
|
||||||
if (retval != ERROR_OK)
|
if (retval != ERROR_OK)
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
data = data ? : &dummy;
|
data = data ? data : &dummy;
|
||||||
retval = stlink_read_dap_register(stlink_dap_handle, ap->ap_num, reg,
|
retval = stlink_read_dap_register(stlink_dap_handle, ap->ap_num, reg,
|
||||||
data);
|
data);
|
||||||
dap->stlink_flush_ap_write = false;
|
dap->stlink_flush_ap_write = false;
|
||||||
|
|
|
@ -5178,7 +5178,7 @@ no_params:
|
||||||
if (goi->argc != 0)
|
if (goi->argc != 0)
|
||||||
goto no_params;
|
goto no_params;
|
||||||
}
|
}
|
||||||
Jim_SetResultString(goi->interp, target->gdb_port_override ? : "undefined", -1);
|
Jim_SetResultString(goi->interp, target->gdb_port_override ? target->gdb_port_override : "undefined", -1);
|
||||||
/* loop for more */
|
/* loop for more */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue