From 14774769daae489834473457712cd4c635ac1fbd Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Sat, 15 Jun 2019 12:25:53 +0200 Subject: drivers/ipmi: Fix coding style Fix 'do not use assignment in if condition'. Change-Id: I6e1b81a1b87de4315391618968c59cc3d3a66a77 Signed-off-by: Patrick Rudolph Reviewed-on: https://review.coreboot.org/c/coreboot/+/33492 Tested-by: build bot (Jenkins) Reviewed-by: Felix Held --- src/drivers/ipmi/ipmi_kcs.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/drivers') diff --git a/src/drivers/ipmi/ipmi_kcs.c b/src/drivers/ipmi/ipmi_kcs.c index 8d106837f9..d17a1f98d2 100644 --- a/src/drivers/ipmi/ipmi_kcs.c +++ b/src/drivers/ipmi/ipmi_kcs.c @@ -144,34 +144,40 @@ static int ipmi_kcs_send_message(int port, int netfn, int lun, int cmd, { int ret; - if ((ret = ipmi_kcs_send_cmd_byte(port, IPMI_KCS_START_WRITE))) { + ret = ipmi_kcs_send_cmd_byte(port, IPMI_KCS_START_WRITE); + if (ret) { printk(BIOS_ERR, "IPMI START WRITE failed\n"); return ret; } - if ((ret = ipmi_kcs_send_data_byte(port, (netfn << 2) | (lun & 3)))) { + ret = ipmi_kcs_send_data_byte(port, (netfn << 2) | (lun & 3)); + if (ret) { printk(BIOS_ERR, "IPMI NETFN failed\n"); return ret; } - if ((ret = ipmi_kcs_send_data_byte(port, cmd))) { + ret = ipmi_kcs_send_data_byte(port, cmd); + if (ret) { printk(BIOS_ERR, "IPMI CMD failed\n"); return ret; } while (len-- > 1) { - if ((ret = ipmi_kcs_send_data_byte(port, *msg++))) { + ret = ipmi_kcs_send_data_byte(port, *msg++); + if (ret) { printk(BIOS_ERR, "IPMI BYTE WRITE failed\n"); return ret; } } - if ((ret = ipmi_kcs_send_cmd_byte(port, IPMI_KCS_END_WRITE))) { + ret = ipmi_kcs_send_cmd_byte(port, IPMI_KCS_END_WRITE); + if (ret) { printk(BIOS_ERR, "IPMI END WRITE failed\n"); return ret; } - if ((ret = ipmi_kcs_send_last_data_byte(port, *msg++))) { + ret = ipmi_kcs_send_last_data_byte(port, *msg++); + if (ret) { printk(BIOS_ERR, "IPMI BYTE WRITE failed\n"); return ret; } -- cgit v1.2.3