summaryrefslogtreecommitdiff
path: root/lib/ipmi_channel.c
diff options
context:
space:
mode:
authorZdenek Styblik <stybla@turnovfree.net>2015-01-16 21:05:56 +0100
committerZdenek Styblik <stybla@turnovfree.net>2015-01-16 21:05:56 +0100
commit6b8d55d68b5e0b37ea306a22cb6a0d7d932421ff (patch)
tree7c126a0a3d88fff27ee8defd83b6f6ac5ec165ab /lib/ipmi_channel.c
parent12b85b3c7b7b983c419173188faaafcc43f98f0e (diff)
downloadipmitool-6b8d55d68b5e0b37ea306a22cb6a0d7d932421ff.tar.gz
Re-work ccode eval in ipmi_get_channel_medium()
Commit re-works ccode eval in ipmi_get_channel_medium() as the previous one didn't work and led to dead-code.
Diffstat (limited to 'lib/ipmi_channel.c')
-rw-r--r--lib/ipmi_channel.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/ipmi_channel.c b/lib/ipmi_channel.c
index 531ea8e..84c0a43 100644
--- a/lib/ipmi_channel.c
+++ b/lib/ipmi_channel.c
@@ -653,13 +653,11 @@ ipmi_get_channel_medium(struct ipmi_intf *intf, uint8_t channel)
channel_info.channel = channel;
ccode = _ipmi_get_channel_info(intf, &channel_info);
- if (ccode < 0) {
- eval_ccode(ccode);
- lprintf(LOG_ERR, "Get Channel Info command failed");
- return 0;
- } else if (ccode = 0xCC) {
+ if (ccode == 0xCC) {
return IPMI_CHANNEL_MEDIUM_RESERVED;
- } else {
+ } else if (ccode < 0 && eval_ccode(ccode) != 0) {
+ return 0;
+ } else if (ccode > 0) {
lprintf(LOG_ERR, "Get Channel Info command failed: %s",
val2str(ccode, completion_code_vals));
return IPMI_CHANNEL_MEDIUM_RESERVED;