summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Melin <tomas.melin@vaisala.com>2016-08-29 11:41:10 -0400
committerChris Ball <chris@printf.net>2016-08-29 12:02:59 -0400
commit3c02759595f4c210655769cc76022ebfee4d13f9 (patch)
treea81eca902beada14cc5b6c99e79d4837408be909
parenta3d3331e6854a4607133bed152988d51250107ca (diff)
downloadmmc-utils-old-3c02759595f4c210655769cc76022ebfee4d13f9.tar.gz
Fix reported offset for enhanced user area start address
Block-addressed devices should have address multiplied with sector size. Clarify with comment how is_blockaddressed() is calculated. Signed-off-by: Tomas Melin <tomas.melin@vaisala.com> Signed-off-by: Chris Ball <chris@printf.net>
-rw-r--r--mmc_cmds.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mmc_cmds.c b/mmc_cmds.c
index 295d505..2f718a0 100644
--- a/mmc_cmds.c
+++ b/mmc_cmds.c
@@ -795,6 +795,7 @@ int is_blockaddresed(__u8 *ext_csd)
{
unsigned int sectors = get_sector_count(ext_csd);
+ /* over 2GiB devices are block-addressed */
return (sectors > (2u * 1024 * 1024 * 1024) / 512);
}
@@ -1659,7 +1660,7 @@ int do_read_extcsd(int nargs, char **argv)
printf("Enhanced User Data Start Address"
" [ENH_START_ADDR]: 0x%06x\n", regl);
printf(" i.e. %lu bytes offset\n", (is_blockaddresed(ext_csd) ?
- 1l : 512l) * regl);
+ 512l : 1l) * regl);
/* A441]: reserved [135] */
printf("Bad Block Management mode"