From patchwork Tue Nov 10 05:00:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stewart Smith X-Patchwork-Id: 542166 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D099E1402B4 for ; Tue, 10 Nov 2015 16:00:37 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id B6E2C1A025E for ; Tue, 10 Nov 2015 16:00:37 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from e17.ny.us.ibm.com (e17.ny.us.ibm.com [129.33.205.207]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 458F01A0239 for ; Tue, 10 Nov 2015 16:00:34 +1100 (AEDT) Received: from localhost by e17.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 10 Nov 2015 00:00:31 -0500 Received: from d01dlp03.pok.ibm.com (9.56.250.168) by e17.ny.us.ibm.com (146.89.104.204) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 10 Nov 2015 00:00:30 -0500 X-IBM-Helo: d01dlp03.pok.ibm.com X-IBM-MailFrom: stewart@linux.vnet.ibm.com X-IBM-RcptTo: skiboot@lists.ozlabs.org Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id B4767C9003C for ; Mon, 9 Nov 2015 23:48:39 -0500 (EST) Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id tAA50Twa59113492 for ; Tue, 10 Nov 2015 05:00:29 GMT Received: from d01av01.pok.ibm.com (localhost [127.0.0.1]) by d01av01.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id tAA50SaQ012527 for ; Tue, 10 Nov 2015 00:00:28 -0500 Received: from oc8180480414.ibm.com ([9.81.198.226]) by d01av01.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with SMTP id tAA506Qa011222; Tue, 10 Nov 2015 00:00:23 -0500 Received: from ka1.ozlabs.ibm.com (localhost [127.0.0.1]) by oc8180480414.ibm.com (Postfix) with ESMTP id 1D3423D2B; Tue, 10 Nov 2015 16:00:05 +1100 (AEDT) From: Stewart Smith To: skiboot@lists.ozlabs.org Date: Tue, 10 Nov 2015 16:00:03 +1100 Message-Id: <1447131603-32315-1-git-send-email-stewart@linux.vnet.ibm.com> X-Mailer: git-send-email 2.1.4 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15111005-0041-0000-0000-00000249948A Subject: [Skiboot] [PATCH] llvm-scan-build: fix value is never read warning X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" 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 --- hw/fsp/fsp-sensor.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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 */