mtd: nandsim: simplify NS_RAW_OFFSET()

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Aug 5 16:59:06 EDT 2013


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=3b8b8fa1ede2ea9f52a550fdddf2dda53ce52fc8
Commit:     3b8b8fa1ede2ea9f52a550fdddf2dda53ce52fc8
Parent:     f03a5729287a8bc1eb061a2f849b5a33ed9cd3ab
Author:     Akinobu Mita <akinobu.mita at gmail.com>
AuthorDate: Sun Jul 28 11:21:55 2013 +0900
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Mon Aug 5 21:05:35 2013 +0100

    mtd: nandsim: simplify NS_RAW_OFFSET()
    
    Simplify the definision of NS_RAW_OFFSET() by using (ns)->geom.pgszoob
    which holds the sum of page size and OOB size.
    
    Signed-off-by: Akinobu Mita <akinobu.mita at gmail.com>
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/nand/nandsim.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c
index ac1b46c..7aa7b19 100644
--- a/drivers/mtd/nand/nandsim.c
+++ b/drivers/mtd/nand/nandsim.c
@@ -205,7 +205,7 @@ MODULE_PARM_DESC(bch,		 "Enable BCH ecc and set how many bits should "
 
 /* Calculate the page offset in flash RAM image by (row, column) address */
 #define NS_RAW_OFFSET(ns) \
-	(((ns)->regs.row << (ns)->geom.pgshift) + ((ns)->regs.row * (ns)->geom.oobsz) + (ns)->regs.column)
+	(((ns)->regs.row * (ns)->geom.pgszoob) + (ns)->regs.column)
 
 /* Calculate the OOB offset in flash RAM image by (row, column) address */
 #define NS_RAW_OFFSET_OOB(ns) (NS_RAW_OFFSET(ns) + ns->geom.pgsz)



More information about the linux-mtd-cvs mailing list