summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/mtdswap.c
Commit message (Collapse)AuthorAgeFilesLines
* mtd: use __packed shorthandBrian Norris2014-08-191-1/+1
| | | | Signed-off-by: Brian Norris <computersforpeace@gmail.com>
* mtd: mtdswap: fix integer overflowBrian Norris2014-08-191-1/+1
| | | | | | Caught by Coverity. Signed-off-by: Brian Norris <computersforpeace@gmail.com>
* mtd: Fixed checkpatch seq_printf warningsSamarth Parikh2014-08-191-2/+2
| | | | | | | | | | | | | | | | | | | | | 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>
* mtd: mtdswap: replace strict_strtoul() with kstrtoul()Jingoo Han2013-08-301-1/+1
| | | | | | | | | | 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>
* mtd: do not use mtd->block_markbad directlyArtem Bityutskiy2012-01-091-1/+1
| | | | | | | | 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>
* mtd: introduce mtd_can_have_bb helperArtem Bityutskiy2012-01-091-2/+2
| | | | | | | | | 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>
* mtd: do not use mtd->sync directlyArtem Bityutskiy2012-01-091-2/+1
| | | | | | | | | 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>
* mtd: introduce mtd_block_markbad interfaceArtem Bityutskiy2012-01-091-1/+1
| | | | | Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* mtd: introduce mtd_block_isbad interfaceArtem Bityutskiy2012-01-091-2/+2
| | | | | Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* mtd: introduce mtd_sync interfaceArtem Bityutskiy2012-01-091-1/+1
| | | | | Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* mtd: introduce mtd_write_oob interfaceArtem Bityutskiy2012-01-091-2/+2
| | | | | Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* mtd: introduce mtd_read_oob interfaceArtem Bityutskiy2012-01-091-2/+2
| | | | | Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* mtd: introduce mtd_write interfaceArtem Bityutskiy2012-01-091-1/+1
| | | | | Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* mtd: introduce mtd_read interfaceArtem Bityutskiy2012-01-091-2/+2
| | | | | Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* mtd: introduce mtd_erase interfaceArtem Bityutskiy2012-01-091-1/+1
| | | | | | | | | | | | | | | | | | | 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>
* mtd: utilize `mtd_is_*()' functionsBrian Norris2011-09-211-10/+10
| | | | | Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
* mtd: rename MTD_OOB_* to MTD_OPS_*Brian Norris2011-09-111-3/+3
| | | | | | | | | | 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>
* mtd: spelling fixesBrian Norris2011-09-111-1/+1
| | | | | Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
* mtd: convert vmalloc/memset to vzallocJoe Perches2011-08-151-2/+1
| | | | | Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
* mtd: mtdswap: fix possible null dereferenceMaxin B. John2011-05-251-1/+7
| | | | | | | | | 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>
* mtd: mtdswap: fix printk format warningRandy Dunlap2011-04-011-1/+1
| | | | | | | | | | 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>
* mtd: mtdswap: fix compilation warningArtem Bityutskiy2011-03-251-1/+1
| | | | | | | | | | | | 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>
* mtdswap: kill strict error handling optionYang Ruirui2011-03-251-7/+1
| | | | | | | | | | 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>
* mtd: fix printf format warnings, mostly lack of %zd for size_t, in mtdswapDavid Woodhouse2011-03-111-8/+8
| | | | Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* mtd: Add mtdswap block driverJarkko Lavinen2011-03-111-0/+1593
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>
OpenPOWER on IntegriCloud