From: Venkatraman S Date: Tue, 7 Aug 2012 13:59:06 +0000 (+0530) Subject: mmc: debugfs: Print ext_csd in ascending order X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6780162c0097915dbc4e8fc11af662a270093d85;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git mmc: debugfs: Print ext_csd in ascending order ext_csd exported through debugfs is printed in reverse order (from byte 511 to 0), which causes confusion. Fix the for loop to print ext_csd in natural order. Signed-off-by: Venkatraman S Acked-by: Felipe Balbi Signed-off-by: Chris Ball --- diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c index 9ab5b17d488a..d96c643dde1c 100644 --- a/drivers/mmc/core/debugfs.c +++ b/drivers/mmc/core/debugfs.c @@ -281,7 +281,7 @@ static int mmc_ext_csd_open(struct inode *inode, struct file *filp) if (err) goto out_free; - for (i = 511; i >= 0; i--) + for (i = 0; i < 512; i++) n += sprintf(buf + n, "%02x", ext_csd[i]); n += sprintf(buf + n, "\n"); BUG_ON(n != EXT_CSD_STR_LEN);