{
if (type_pre > 0) {
/* not the first command */
- if (NULL == usbtoxxx_buffer) {
+ if (!usbtoxxx_buffer) {
LOG_BUG(ERRMSG_INVALID_BUFFER, TO_STR(usbtoxxx_buffer));
return ERRCODE_INVALID_BUFFER;
}
struct versaloon_want_pos_t *tmp;
tmp = versaloon_pending[i].pos;
- while (tmp != NULL) {
- if ((tmp->buff != NULL) && (tmp->size > 0)) {
+ while (tmp) {
+ if ((tmp->buff) && (tmp->size > 0)) {
memcpy(tmp->buff,
versaloon_buf + usbtoxxx_buffer_index
+ tmp->offset,
if (ERROR_OK != usbtoxxx_ensure_buffer_size(cmdlen + 6))
return ERROR_FAIL;
- if ((type_pre != type) || (NULL == usbtoxxx_buffer)) {
+ if ((type_pre != type) || (!usbtoxxx_buffer)) {
if (ERROR_OK != usbtoxxx_validate_current_command_type()) {
LOG_BUG(ERRMSG_FAILURE_OPERATION, "validate previous commands");
return ERRCODE_FAILURE_OPERATION;
SET_LE_U16(&usbtoxxx_buffer[collect_index], len_tmp);
}
- if (cmdbuf != NULL) {
+ if (cmdbuf) {
memcpy(usbtoxxx_buffer + usbtoxxx_current_cmd_index, cmdbuf, cmdlen);
usbtoxxx_current_cmd_index += cmdlen;
}