projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
633dccb
)
megasas: fix megasas_get_sata_addr
author
Paolo Bonzini
<pbonzini@redhat.com>
Wed, 30 Sep 2015 17:21:10 +0000
(19:21 +0200)
committer
Paolo Bonzini
<pbonzini@redhat.com>
Mon, 12 Oct 2015 16:29:25 +0000
(18:29 +0200)
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 <pbonzini@redhat.com>
hw/scsi/megasas.c
patch
|
blob
|
history
diff --git
a/hw/scsi/megasas.c
b/hw/scsi/megasas.c
index a04369c5added90670df7bc0ae3e41d8ac835586..dcd724e6a58c33e5d4dac83374312f02281c7533 100644
(file)
--- 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);
}
/*