diff mbox

llvm-scan-build: fix value is never read warning

Message ID 1447131603-32315-1-git-send-email-stewart@linux.vnet.ibm.com
State Accepted
Headers show

Commit Message

Stewart Smith Nov. 10, 2015, 5 a.m. UTC
hw/fsp/fsp-sensor.c:425:3: warning: Value stored to 'sensor_buf_ptr' is never read
                sensor_buf_ptr = (uint32_t *)((uint8_t *)sensor_buffer +
                ^                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

Patch

diff --git a/hw/fsp/fsp-sensor.c b/hw/fsp/fsp-sensor.c
index f562ab20397d..a2605d667660 100644
--- a/hw/fsp/fsp-sensor.c
+++ b/hw/fsp/fsp-sensor.c
@@ -409,7 +409,6 @@  static int64_t fsp_sensor_send_read_request(struct opal_sensor_data *attr)
 {
 	int rc;
 	struct fsp_msg *msg;
-	uint32_t *sensor_buf_ptr;
 	uint32_t align;
 	uint32_t cmd_header;
 
@@ -418,12 +417,9 @@  static int64_t fsp_sensor_send_read_request(struct opal_sensor_data *attr)
 
 	if (spcn_mod_data[attr->mod_index].mod == SPCN_MOD_PROC_JUNC_TEMP) {
 		/* TODO Support this modifier '0x14', if required */
-		align = attr->offset % sizeof(*sensor_buf_ptr);
+		align = attr->offset % sizeof(uint32_t);
 		if (align)
-			attr->offset += (sizeof(*sensor_buf_ptr) - align);
-
-		sensor_buf_ptr = (uint32_t *)((uint8_t *)sensor_buffer +
-				attr->offset);
+			attr->offset += (sizeof(uint32_t) - align);
 
 		/* TODO Add 8 byte command data required for mod 0x14 */