From ed1865da0a5f297d9fe8128b6846e9a2a4c522c1 Mon Sep 17 00:00:00 2001 From: Zdenek Styblik Date: Wed, 13 Feb 2013 11:35:21 +0000 Subject: [PATCH] ID: 3600928 - 'lib/ipmi_pef.c' use 'else if ()' instead of 'if ()' Commit trades 'if ()' for 'else if ()' and removes one pointless 'if ()' since rsp isn't NULL at this point. --- ipmitool/lib/ipmi_pef.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/ipmitool/lib/ipmi_pef.c b/ipmitool/lib/ipmi_pef.c index 7d183da..c495119 100644 --- a/ipmitool/lib/ipmi_pef.c +++ b/ipmitool/lib/ipmi_pef.c @@ -193,18 +193,17 @@ ipmi_pef_msg_exchange(struct ipmi_intf * intf, struct ipmi_rq * req, char * txt) // common IPMItool rqst/resp handling */ struct ipmi_rs * rsp = intf->sendrecv(intf, req); - if (!rsp) + if (!rsp) { return(NULL); - if (rsp->ccode == 0x80) { + } else if (rsp->ccode == 0x80) { return(NULL); /* Do not output error, just unsupported parameters */ - } - else if (rsp->ccode) { - lprintf(LOG_ERR, " **Error %x in '%s' command", - rsp ? rsp->ccode : 0, txt); + } else if (rsp->ccode) { + lprintf(LOG_ERR, " **Error %x in '%s' command", rsp->ccode, txt); return(NULL); } - if (verbose > 2) + if (verbose > 2) { printbuf(rsp->data, rsp->data_len, txt); + } return(rsp); }