From: Paolo Bonzini Date: Wed, 30 Sep 2015 17:21:10 +0000 (+0200) Subject: megasas: fix megasas_get_sata_addr X-Git-Tag: TizenStudio_2.0_p2.3.2~120^2~1^2~129^2~46 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8ef2eb8d2cad7400236d6b2c152bdb5506761b4d;p=sdk%2Femulator%2Fqemu.git megasas: fix megasas_get_sata_addr There are two bugs here. First, the 16-bit id loses the high 8 bits when shifted left by 24. Second, the address must be combined with an "or" or we just get zero. Signed-off-by: Paolo Bonzini --- diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c index a04369c..dcd724e 100644 --- a/hw/scsi/megasas.c +++ b/hw/scsi/megasas.c @@ -431,7 +431,7 @@ static uint64_t megasas_fw_time(void) static uint64_t megasas_get_sata_addr(uint16_t id) { uint64_t addr = (0x1221ULL << 48); - return addr & (id << 24); + return addr | ((uint64_t)id << 24); } /*