diff mbox

llvm-scan-build: fix dead assignment warning

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

Commit Message

Stewart Smith Nov. 10, 2015, 4:54 a.m. UTC
hw/fsp/fsp-sensor.c:748:4: 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 d83f1a1fc2ab..f562ab20397d 100644
--- a/hw/fsp/fsp-sensor.c
+++ b/hw/fsp/fsp-sensor.c
@@ -712,7 +712,6 @@  void fsp_init_sensor(void)
 {
 	uint32_t cmd_header, align, size, psi_dma_offset = 0;
 	enum spcn_rsp_status status;
-	uint32_t *sensor_buf_ptr;
 	struct fsp_msg msg, resp;
 	int index, rc;
 
@@ -741,12 +740,9 @@  void fsp_init_sensor(void)
 		      spcn_mod_data[index].mod);
 		if (spcn_mod_data[index].mod == SPCN_MOD_PROC_JUNC_TEMP) {
 			/* TODO Support this modifier 0x14, if required */
-			align = psi_dma_offset % sizeof(*sensor_buf_ptr);
+			align = psi_dma_offset % sizeof(uint32_t);
 			if (align)
-				psi_dma_offset += (sizeof(*sensor_buf_ptr) - align);
-
-			sensor_buf_ptr = (uint32_t *)((uint8_t *)sensor_buffer
-					+ psi_dma_offset);
+				psi_dma_offset += (sizeof(uint32_t) - align);
 
 			/* TODO Add 8 byte command data required for mod 0x14 */
 			psi_dma_offset += 8;