History log of /drivers/mtd/mtdswap.c
Revision Date Author Comments
31f754628cbb12c983600f22d9f0fed50dfe2134 22-Jul-2014 Brian Norris <computersforpeace@gmail.com> mtd: use __packed shorthand

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
8c3f3f1d7941bcb25590b784f84accd7dcb44ba3 22-Jul-2014 Brian Norris <computersforpeace@gmail.com> mtd: mtdswap: fix integer overflow

Caught by Coverity.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
6f3c0f163103fb225c77b73ca17fc4ecea308103 16-Jul-2014 Samarth Parikh <samarthp@ymail.com> mtd: Fixed checkpatch seq_printf warnings

Fixed checkpatch warnings: "WARNING: Prefer seq_puts to seq_printf"

This patch is created with reference to the ongoing lkml thread
https://lkml.org/lkml/2014/7/15/646
where Andrew Morton wrote:

"
- puts is presumably faster

- puts doesn't go rogue if you accidentally pass it a "%".

- this patch would actually make compiled object files few bytes smaller.
Perhaps because seq_printf() is a varargs function, forcing the
caller to pass args on the stack instead of in registers.
"

Signed-off-by: Samarth Parikh <samarthp@ymail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
3156231fb644cf29c1d7f21766ff9e33dc9761d3 19-Jul-2013 Jingoo Han <jg1.han@samsung.com> mtd: mtdswap: replace strict_strtoul() with kstrtoul()

The usage of strict_strtoul() is not preferred, because
strict_strtoul() is obsolete. Thus, kstrtoul() should be
used.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
800ffd3496987e91f599a135060ef49731e045ac 02-Jan-2012 Artem Bityutskiy <artem.bityutskiy@linux.intel.com> mtd: do not use mtd->block_markbad directly

Instead, use the new 'mtd_can_have_bb()', or just rely on 'mtd_block_markbad()'
return code, which will be -EOPNOTSUPP if bad blocks are not supported.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
8f461a730242c528ca221948edceca49266a3ffb 02-Jan-2012 Artem Bityutskiy <artem.bityutskiy@linux.intel.com> mtd: introduce mtd_can_have_bb helper

This patch introduces new 'mtd_can_have_bb()' helper function which checks
whether the flash can have bad eraseblocks. Then it changes all the
direct 'mtd->block_isbad' use cases with 'mtd_can_have_bb()'.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
327cf2922b4edf0439b219469722d2a502e37349 30-Dec-2011 Artem Bityutskiy <artem.bityutskiy@linux.intel.com> mtd: do not use mtd->sync directly

This patch teaches 'mtd_sync()' to do nothing when the MTD driver does
not have the '->sync()' method, which allows us to remove all direct
'mtd->sync' accesses.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
5942ddbc500d1c9b75e571b656be97f65b26adfe 23-Dec-2011 Artem Bityutskiy <artem.bityutskiy@linux.intel.com> mtd: introduce mtd_block_markbad interface

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
7086c19d07429d697057587caf1e5e0345442d16 23-Dec-2011 Artem Bityutskiy <artem.bityutskiy@linux.intel.com> mtd: introduce mtd_block_isbad interface

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
85f2f2a809d658c15b574df02ede92090f45a1f2 23-Dec-2011 Artem Bityutskiy <artem.bityutskiy@linux.intel.com> mtd: introduce mtd_sync interface

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
a2cc5ba075f9bc837d0b4d4ec7328dcefc11859d 23-Dec-2011 Artem Bityutskiy <artem.bityutskiy@linux.intel.com> mtd: introduce mtd_write_oob interface

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
fd2819bbc92fc98bed5d612e4acbe16b6326f6bf 23-Dec-2011 Artem Bityutskiy <artem.bityutskiy@linux.intel.com> mtd: introduce mtd_read_oob interface

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
eda95cbf75193808f62948fb0142ba0901d8bee2 23-Dec-2011 Artem Bityutskiy <artem.bityutskiy@linux.intel.com> mtd: introduce mtd_write interface

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
329ad399a9b3adf52c90637b21ca029fcf7f8795 23-Dec-2011 Artem Bityutskiy <artem.bityutskiy@linux.intel.com> mtd: introduce mtd_read interface

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
7e1f0dc0551b99acb5e8fa161a7ac401994d57d8 23-Dec-2011 Artem Bityutskiy <artem.bityutskiy@linux.intel.com> mtd: introduce mtd_erase interface

This patch is part of a patch-set which changes the MTD interface
from 'mtd->func()' form to 'mtd_func()' form. We need this because
we want to add common code to to all drivers in the mtd core level,
which is impossible with the current interface when MTD clients
call driver functions like 'read()' or 'write()' directly.

At this point we just introduce a new inline wrapper function, but
later some of them are expected to gain more code. E.g., the input
parameters check should be moved to the wrappers rather than be
duplicated at many drivers.

This particular patch introduced the 'mtd_erase()' interface. The
following patches add all the other interfaces one by one.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
d57f40544a41fdfe90fd863b6865138c5a82f1cc 21-Sep-2011 Brian Norris <computersforpeace@gmail.com> mtd: utilize `mtd_is_*()' functions

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
0612b9ddc2eeda014dd805c87c752b342d8f80f0 31-Aug-2011 Brian Norris <computersforpeace@gmail.com> mtd: rename MTD_OOB_* to MTD_OPS_*

These modes are not necessarily for OOB only. Particularly, MTD_OOB_RAW
affected operations on in-band page data as well. To clarify these
options and to emphasize that their effect is applied per-operation, we
change the primary prefix to MTD_OPS_.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
92394b5c2be774425f255b5c7afbd8b19978fe12 20-Jul-2011 Brian Norris <computersforpeace@gmail.com> mtd: spelling fixes

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
1712cde28532d9b0c98142e08a131b344d3200bd 28-May-2011 Joe Perches <joe@perches.com> mtd: convert vmalloc/memset to vzalloc

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
8d8f26e19cae48541b824f164021e1ff05067f8c 20-May-2011 Maxin B. John <john.maxin@nokia.com> mtd: mtdswap: fix possible null dereference

This patch fixes the possible null dereference of the variable "oinfo"
Thanks to Coverity for spotting this.

Signed-off-by: Maxin B. John <john.maxin@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2130ad32a03f8d2d772cbbd94eff5358d8ab9e33 29-Mar-2011 Randy Dunlap <randy.dunlap@oracle.com> mtd: mtdswap: fix printk format warning

The number is actually a sizeof(), so using %zu for it builds
cleanly on 32-bit or 64-bit.

drivers/mtd/mtdswap.c:1456: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'unsigned int'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
68b1a1e786f29c900fa1c516a402e24f0ece622a 25-Mar-2011 Artem Bityutskiy <Artem.Bityutskiy@nokia.com> mtd: mtdswap: fix compilation warning

Fix the following compilation warning:

drivers/mtd/mtdswap.c: In function ‘mtdswap_pick_gc_eblk’:
drivers/mtd/mtdswap.c:859: warning: ‘idx’ may be used uninitialized in this function
drivers/mtd/mtdswap.c:859: note: ‘idx’ was declared here

Initialize idx to -1 because this value means "no tree choosen".

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
e21fa86ad0ffa2c292b104ea19bdaa46ceab7105 14-Mar-2011 Yang Ruirui <ruirui.r.yang@tieto.com> mtdswap: kill strict error handling option

As Artem Bityutskiy suggested: this option is controversial, as we
do not really have any prove it is useful. And it is too much to have
it as a config parameter. So, better kill it and let the real mtdswap
users decide whether it is needed or not.

Signed-off-by: Yang Ruirui<ruirui.r.yang@tieto.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
89d8d32060de17c23f761df74799c7c07b79dd01 11-Mar-2011 David Woodhouse <David.Woodhouse@intel.com> mtd: fix printf format warnings, mostly lack of %zd for size_t, in mtdswap

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
a321590246202f2598aca2f4ef63b992e8fc97ef 14-Feb-2011 Jarkko Lavinen <jarkko.lavinen@nokia.com> mtd: Add mtdswap block driver

Add a driver for allowing an mtd device to be used as a block device for
swapping. The block device is volatile, and the mapping of swapped pages
is not stored on flash.

Signed-off-by: Jarkko Lavinen <jarkko.lavinen@nokia.com>
Tested-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>