diff mbox

[7/7] llvm-scan-build: fix dead assignment in hw/lpc.c

Message ID 1447141453-19876-8-git-send-email-stewart@linux.vnet.ibm.com
State Accepted
Headers show

Commit Message

Stewart Smith Nov. 10, 2015, 7:44 a.m. UTC
hw/lpc.c:533:3: warning: Value stored to 'rc' is never read
                rc = opb_read(chip, lpc_reg_opb_base + LPC_HC_IRQMASK, &val, 4);
                ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
hw/lpc.c:535:3: warning: Value stored to 'rc' is never read
                rc = opb_read(chip, lpc_reg_opb_base + LPC_HC_IRQSER_CTRL, &val, 4);
                ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
---
 hw/lpc.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/hw/lpc.c b/hw/lpc.c
index 0e88e9f0081b..60fefdb1c969 100644
--- a/hw/lpc.c
+++ b/hw/lpc.c
@@ -531,9 +531,16 @@  static void lpc_setup_serirq(struct proc_chip *chip)
 	{
 		u32 val;
 		rc = opb_read(chip, lpc_reg_opb_base + LPC_HC_IRQMASK, &val, 4);
-		DBG_IRQ("LPC: MASK READBACK=%x\n", val);
+		if (rc)
+			prerror("LPC: failed to readback mask");
+		else
+			DBG_IRQ("LPC: MASK READBACK=%x\n", val);
+
 		rc = opb_read(chip, lpc_reg_opb_base + LPC_HC_IRQSER_CTRL, &val, 4);
-		DBG_IRQ("LPC: CTRL READBACK=%x\n", val);
+		if (rc)
+			prerror("LPC: failed to readback ctrl");
+		else
+			DBG_IRQ("LPC: CTRL READBACK=%x\n", val);
 	}
 }