Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33492
Change subject: drivers/ipmi: Fix coding style ......................................................................
drivers/ipmi: Fix coding style
Fix 'do not use assignment in if condition'.
Change-Id: I6e1b81a1b87de4315391618968c59cc3d3a66a77 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/drivers/ipmi/ipmi_kcs.c 1 file changed, 12 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/92/33492/1
diff --git a/src/drivers/ipmi/ipmi_kcs.c b/src/drivers/ipmi/ipmi_kcs.c index 8d106837..d17a1f9 100644 --- a/src/drivers/ipmi/ipmi_kcs.c +++ b/src/drivers/ipmi/ipmi_kcs.c @@ -144,34 +144,40 @@ { 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; }
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33492 )
Change subject: drivers/ipmi: Fix coding style ......................................................................
Patch Set 1: Code-Review+2
Patrick Rudolph has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/33492 )
Change subject: drivers/ipmi: Fix coding style ......................................................................
drivers/ipmi: Fix coding style
Fix 'do not use assignment in if condition'.
Change-Id: I6e1b81a1b87de4315391618968c59cc3d3a66a77 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/33492 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Felix Held felix-coreboot@felixheld.de --- M src/drivers/ipmi/ipmi_kcs.c 1 file changed, 12 insertions(+), 6 deletions(-)
Approvals: build bot (Jenkins): Verified Felix Held: Looks good to me, approved
diff --git a/src/drivers/ipmi/ipmi_kcs.c b/src/drivers/ipmi/ipmi_kcs.c index 8d106837..d17a1f9 100644 --- a/src/drivers/ipmi/ipmi_kcs.c +++ b/src/drivers/ipmi/ipmi_kcs.c @@ -144,34 +144,40 @@ { 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; }