Do inspect the return value of the routine which sends the command
before retrieving the response. This silences the following warnings:
../src/hardware/korad-kaxxxxp/protocol.c:179:3: warning: Value stored to 'ret' is never read
ret = korad_kaxxxxp_send_cmd(serial, "IOUT1?");
../src/hardware/korad-kaxxxxp/protocol.c:184:3: warning: Value stored to 'ret' is never read
ret = korad_kaxxxxp_send_cmd(serial, "ISET1?");
../src/hardware/korad-kaxxxxp/protocol.c:189:3: warning: Value stored to 'ret' is never read
ret = korad_kaxxxxp_send_cmd(serial, "VOUT1?");
../src/hardware/korad-kaxxxxp/protocol.c:194:3: warning: Value stored to 'ret' is never read
ret = korad_kaxxxxp_send_cmd(serial, "VSET1?");
../src/hardware/korad-kaxxxxp/protocol.c:202:3: warning: Value stored to 'ret' is never read
ret = korad_kaxxxxp_send_cmd(serial, "STATUS?");
break;
default:
sr_err("Don't know how to query %d.", target);
+ ret = SR_ERR;
+ }
+ if (ret != SR_OK) {
g_mutex_unlock(&devc->rw_mutex);
- return SR_ERR;
+ return ret;
}
devc->req_sent_at = g_get_monotonic_time();