diff mbox

ibm-fsp/firenze: Fix unused overwritten value

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

Commit Message

Stewart Smith June 21, 2016, 1:57 a.m. UTC
Found with static analysis:

939        id = ((uint64_t)p[1] << 32) | p[2];
    value_overwrite: Overwriting previous write to id with value 0ULL.
940        id = 0;

Fixes: 6884fe63
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
---
 platforms/ibm-fsp/firenze-pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Gavin Shan June 21, 2016, 2:13 a.m. UTC | #1
On Tue, Jun 21, 2016 at 11:57:52AM +1000, Stewart Smith wrote:
>Found with static analysis:
>
>939        id = ((uint64_t)p[1] << 32) | p[2];
>    value_overwrite: Overwriting previous write to id with value 0ULL.
>940        id = 0;
>
>Fixes: 6884fe63
>Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>

Acked-by: Gavin Shan <gwshan@linux.vnet.ibm.com>

Stewart, thanks for fixing it up.

Thanks,
Gavin

>---
> platforms/ibm-fsp/firenze-pci.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/platforms/ibm-fsp/firenze-pci.c b/platforms/ibm-fsp/firenze-pci.c
>index b13f1e52fc05..4a9aff300504 100644
>--- a/platforms/ibm-fsp/firenze-pci.c
>+++ b/platforms/ibm-fsp/firenze-pci.c
>@@ -937,7 +937,7 @@ static void firenze_pci_slot_fixup(struct pci_slot *slot)
> 
> 	/* FIXME: support fixup with generic way */
> 	id = ((uint64_t)p[1] << 32) | p[2];
>-	id = 0;
>+
> 	if (id != LX_VPD_2S4U_BACKPLANE &&
> 	    id != LX_VPD_1S4U_BACKPLANE)
> 		return;
>-- 
>2.1.4
>
>_______________________________________________
>Skiboot mailing list
>Skiboot@lists.ozlabs.org
>https://lists.ozlabs.org/listinfo/skiboot
diff mbox

Patch

diff --git a/platforms/ibm-fsp/firenze-pci.c b/platforms/ibm-fsp/firenze-pci.c
index b13f1e52fc05..4a9aff300504 100644
--- a/platforms/ibm-fsp/firenze-pci.c
+++ b/platforms/ibm-fsp/firenze-pci.c
@@ -937,7 +937,7 @@  static void firenze_pci_slot_fixup(struct pci_slot *slot)
 
 	/* FIXME: support fixup with generic way */
 	id = ((uint64_t)p[1] << 32) | p[2];
-	id = 0;
+
 	if (id != LX_VPD_2S4U_BACKPLANE &&
 	    id != LX_VPD_1S4U_BACKPLANE)
 		return;