From: David van Moolenbroek Date: Tue, 22 Oct 2013 13:58:59 +0000 (+0000) Subject: ahci: fix integer sign extension bug X-Git-Tag: v3.3.0~739 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/index.css?a=commitdiff_plain;h=36041198ad87402344367976358eca346bd79775;p=minix.git ahci: fix integer sign extension bug Reported by Coverity. Change-Id: Ie7eef9570c89c69a05ba45169a0ea838f0d8e320 --- 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 &&