projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4b5dfd8
)
sd: do not add one sector to the disk size
author
Vincent Palatin
<vpalatin@chromium.org>
Mon, 25 Jul 2011 23:19:05 +0000
(16:19 -0700)
committer
Andrzej Zaborowski
<andrew.zaborowski@intel.com>
Sat, 30 Jul 2011 05:26:40 +0000
(07:26 +0200)
This leads to random off-by-one error.
When the size of the SD is exactly 1GB, the emulation was returning a
wrong SDHC CSD descriptor.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
hw/sd.c
patch
|
blob
|
history
diff --git
a/hw/sd.c
b/hw/sd.c
index 219a0dd296d88dc1b633e5664ee512c174c5fc78..c2c80ab7b891efd9af9dfce9efade09666fcd1b4 100644
(file)
--- a/
hw/sd.c
+++ b/
hw/sd.c
@@
-393,9
+393,7
@@
static void sd_reset(SDState *sd, BlockDriverState *bdrv)
} else {
sect = 0;
}
- sect <<= 9;
-
- size = sect + 1;
+ size = sect << 9;
sect = (size >> (HWBLOCK_SHIFT + SECTOR_SHIFT + WPGROUP_SHIFT)) + 1;