From 36041198ad87402344367976358eca346bd79775 Mon Sep 17 00:00:00 2001 From: David van Moolenbroek Date: Tue, 22 Oct 2013 13:58:59 +0000 Subject: [PATCH] ahci: fix integer sign extension bug Reported by Coverity. Change-Id: Ie7eef9570c89c69a05ba45169a0ea838f0d8e320 --- drivers/ahci/ahci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/ahci/ahci.c b/drivers/ahci/ahci.c index 2ef4dfb7e..1c7282622 100644 --- a/drivers/ahci/ahci.c +++ b/drivers/ahci/ahci.c @@ -559,7 +559,8 @@ static int ata_id_check(struct port_state *ps, u16_t *buf) /* Get number of LBA blocks, and sector size. */ ps->lba_count = ((u64_t) buf[ATA_ID_LBA3] << 48) | ((u64_t) buf[ATA_ID_LBA2] << 32) | - (buf[ATA_ID_LBA1] << 16) | buf[ATA_ID_LBA0]; + ((u64_t) buf[ATA_ID_LBA1] << 16) | + (u64_t) buf[ATA_ID_LBA0]; /* Determine the queue depth of the device. */ if (hba_state.has_ncq && -- 2.44.0