static void svf_free_xxd_para(struct svf_xxr_para *para)
{
- if (NULL != para) {
+ if (para) {
free(para->tdi);
para->tdi = NULL;
svf_ignore_error = 1;
else {
svf_fd = fopen(CMD_ARGV[i], "r");
- if (svf_fd == NULL) {
+ if (!svf_fd) {
int err = errno;
command_print(CMD, "open(\"%s\"): %s", CMD_ARGV[i], strerror(err));
/* no need to free anything now */
}
}
- if (svf_fd == NULL)
+ if (!svf_fd)
return ERROR_COMMAND_SYNTAX_ERROR;
/* get time */
svf_check_tdo_para_index = 0;
svf_check_tdo_para = malloc(sizeof(struct svf_check_tdo_para) * SVF_CHECK_TDO_PARA_SIZE);
- if (NULL == svf_check_tdo_para) {
+ if (!svf_check_tdo_para) {
LOG_ERROR("not enough memory");
ret = ERROR_FAIL;
goto free_all;
if (cmd_pos + 3 > svf_command_buffer_size) {
svf_command_buffer = realloc(svf_command_buffer, cmd_pos + 3);
svf_command_buffer_size = cmd_pos + 3;
- if (svf_command_buffer == NULL) {
+ if (!svf_command_buffer) {
LOG_ERROR("not enough memory");
return ERROR_FAIL;
}
}
/* If TDO is absent, no comparison is needed, set the mask to 0 */
if (!(xxr_para_tmp->data_mask & XXR_TDO)) {
- if (NULL == xxr_para_tmp->tdo) {
+ if (!xxr_para_tmp->tdo) {
if (ERROR_OK !=
svf_adjust_array_length(&xxr_para_tmp->tdo, i_tmp,
xxr_para_tmp->len)) {
return ERROR_FAIL;
}
}
- if (NULL == xxr_para_tmp->mask) {
+ if (!xxr_para_tmp->mask) {
if (ERROR_OK !=
svf_adjust_array_length(&xxr_para_tmp->mask, i_tmp,
xxr_para_tmp->len)) {
if (num_of_argu > 2) {
/* STATE pathstate1 ... stable_state */
path = malloc((num_of_argu - 1) * sizeof(tap_state_t));
- if (NULL == path) {
+ if (!path) {
LOG_ERROR("not enough memory");
return ERROR_FAIL;
}