summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/nandsim.c
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2013-07-28 04:21:55 +0200
committerDavid Woodhouse <David.Woodhouse@intel.com>2013-08-05 22:05:35 +0200
commit3b8b8fa1ede2ea9f52a550fdddf2dda53ce52fc8 (patch)
treee6a58dfabd0843b2786a8a8223f9dba5bfb879e9 /drivers/mtd/nand/nandsim.c
parentmtd: nandsim: use kasprintf() (diff)
downloadlinux-3b8b8fa1ede2ea9f52a550fdddf2dda53ce52fc8.tar.xz
linux-3b8b8fa1ede2ea9f52a550fdddf2dda53ce52fc8.zip
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@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/nand/nandsim.c')
-rw-r--r--drivers/mtd/nand/nandsim.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c
index ac1b46cbd33e..7aa7b19d2c13 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)