From 6b8d55d68b5e0b37ea306a22cb6a0d7d932421ff Mon Sep 17 00:00:00 2001 From: Zdenek Styblik Date: Fri, 16 Jan 2015 21:05:56 +0100 Subject: [PATCH] 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. --- lib/ipmi_channel.c | 10 ++++------ 1 file 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;