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

Stewart Smith stewart at linux.vnet.ibm.com
Tue Nov 10 18:44:13 AEDT 2015


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 at linux.vnet.ibm.com>
---
 hw/lpc.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

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);
 	}
 }
 
-- 
2.1.4



More information about the Skiboot mailing list