summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'for-linus-20141015' of git://git.infradead.org/linux-mtdLinus Torvalds2014-10-1845-562/+757
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull MTD update from Brian Norris: "Sorry for delaying this a bit later than usual. There's one mild regression from 3.16 that was noticed during the 3.17 cycle, and I meant to send a fix for it along with this pull request. I'll probably try to queue it up for a later pull request once I've had a better look at it, hopefully by -rc2 at the latest. Summary for this pull: NAND - Cleanup for Denali driver - Atmel: add support for new page sizes - Atmel: fix up 'raw' mode support - Atmel: miscellaneous cleanups - New timing mode helpers for non-ONFI NAND - OMAP: allow driver to be (properly) built as a module - bcm47xx: RESET support and other cleanups SPI NOR - Miscellaneous cleanups, to prepare framework for wider use (some further work still pending) - Compile-time configuration to select 4K vs. 64K support for flash that support both (necessary for using UBIFS on some SPI NOR) A few scattered code quality fixes, detected by Coverity See the changesets for more" * tag 'for-linus-20141015' of git://git.infradead.org/linux-mtd: (59 commits) mtd: nand: omap: Correct CONFIG_MTD_NAND_OMAP_BCH help message mtd: nand: Force omap_elm to be built as a module if omap2_nand is a module mtd: move support for struct flash_platform_data into m25p80 mtd: spi-nor: add Kconfig option to disable 4K sectors mtd: nand: Move ELM driver and rename as omap_elm nand: omap2: Replace pr_err with dev_err nand: omap2: Remove horrible ifdefs to fix module probe mtd: nand: add Hynix's H27UCG8T2ATR-BC to nand_ids table mtd: nand: support ONFI timing mode retrieval for non-ONFI NANDs mtd: physmap_of: Add non-obsolete map_rom probe mtd: physmap_of: Fix ROM support via OF MAINTAINERS: add l2-mtd.git, 'next' tree for MTD mtd: denali: fix indents and other trivial things mtd: denali: remove unnecessary parentheses mtd: denali: remove another set-but-unused variable mtd: denali: fix include guard and license block of denali.h mtd: nand: don't break long print messages mtd: bcm47xxnflash: replace some magic numbers mtd: bcm47xxnflash: NAND_CMD_RESET support mtd: bcm47xxnflash: add cmd_ctrl handler ...
| * mtd: nand: omap: Correct CONFIG_MTD_NAND_OMAP_BCH help messageRoger Quadros2014-10-061-1/+1
| | | | | | | | | | | | | | | | The MTD_NAND_OMAP_BCH doesn't harm on legacy OMAP platforms so don't state that it should be disabled for them. Signed-off-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: nand: Force omap_elm to be built as a module if omap2_nand is a moduleEzequiel Garcia2014-10-062-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds a hidden option to build the omap_elm as a module, if omap2_nand is a module (and similarly in the built-in case). This fixes the following build error when omap2_nand is chosen built-in, and omap_elm is chosen as a module: drivers/built-in.o: In function `omap_nand_probe': drivers/mtd/nand/omap2.c:2010: undefined reference to `elm_config' drivers/mtd/nand/omap2.c:1980: undefined reference to `elm_config' drivers/mtd/nand/omap2.c:1927: undefined reference to `elm_config' drivers/built-in.o: In function `omap_elm_correct_data': drivers/mtd/nand/omap2.c:1444: undefined reference to `elm_decode_bch_error_page' Reported-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: move support for struct flash_platform_data into m25p80Rafał Miłecki2014-09-282-29/+21
| | | | | | | | | | | | | | | | | | | | | | This "type" seems to be an extra hint for m25p80 about the flash. Some archs register flash_platform_data with "name" set to "m25p80" and then with a real flash name set in "type". It seems to be a trick specific to the m25p80 so let's move it out of spi-nor. Btw switch to the spi_nor_match_id instead of iterating spi_nor_ids. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: spi-nor: add Kconfig option to disable 4K sectorsRafał Miłecki2014-09-282-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current situation with 4K sectors is quite messy. First of all, some MTD "users" don't work with such small size. An example may be UBIFS which requires 15 KiB erase blocks as a minimum. In theory spi-nor should provide multiple erase regions and MTD "users" should use the one they need. Unforunately that is not implemented. In the result our flashes database in spi-nor is hackish. For some flashes we pretend they don't support 4K sectors just because some distribution uses UBIFS on it. This ofc leads to conflicts, like Samsung using w25q128 with 4K sectors vs. OpenWrt requiring it to pretend it's 64 KiB blocks only. My idea (plan?) for fixing this situation: 1) Use real hw info (this requires a way for disabling 4K for now) 2) Provide detailed info about erase regions 3) Make UBIFS work with devices that support 4K sectors Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: nand: Move ELM driver and rename as omap_elmEzequiel García2014-09-223-1/+1
| | | | | | | | | | | | | | | | | | | | | | The ELM driver is only used by the OMAP NAND driver, so let's move it to the nand/ directory. Additionally, let's rename it to a less confusing name, so the module is built with a meaningful name, instead of the previous 'elm.ko'. Acked-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * nand: omap2: Replace pr_err with dev_errEzequiel García2014-09-221-13/+17
| | | | | | | | | | | | | | | | Usage of pr_err is frowned upon, so replace it with dev_err. Acked-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * nand: omap2: Remove horrible ifdefs to fix module probeEzequiel García2014-09-222-59/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current code abuses ifdefs to determine if the selected ECC scheme is supported by the running kernel. As a result the code is hard to read, and it also fails to load as a module. This commit removes all the ifdefs and instead introduces a function omap2_nand_ecc_check() to check if the ECC is supported by using IS_ENABLED(CONFIG_xxx). Since IS_ENABLED() is true when a config is =y or =m, this change fixes the module so it can be loaded with no issues. Acked-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: nand: add Hynix's H27UCG8T2ATR-BC to nand_ids tableBoris BREZILLON2014-09-221-0/+4
| | | | | | | | | | | | | | | | | | Add the full description of the Hynix H27UCG8T2ATR-BC NAND chip in the nand_ids table so that we can later use the NAND ECC infos and ONFI timings mode in controller drivers. Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: nand: support ONFI timing mode retrieval for non-ONFI NANDsBoris BREZILLON2014-09-222-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an onfi_timing_mode_default field to nand_chip and nand_flash_dev in order to support NAND timings definition for non-ONFI NAND. NAND that support better timings mode than the default one have to define a new entry in the nand_ids table. The default timing mode should be deduced from timings description from the datasheet and the ONFI specification (www.onfi.org/~/media/ONFI/specs/onfi_3_1_spec.pdf, chapter 4.15 "Timing Parameters"). You should choose the closest mode that fit the timings requirements of your NAND chip. Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: physmap_of: Add non-obsolete map_rom probeAaron Sierra2014-09-222-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | Previously, the only way to map a NOR device as a simple ROM was to use the obsolete "direct-mapped" compatible binding (which further requires device_type = "nor" and probe-type = "NOR" properties). This patch adds an "mtd-rom" compatible binding to the "map_rom" probe type. Signed-off-by: Aaron Sierra <asierra@xes-inc.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: physmap_of: Fix ROM support via OFAaron Sierra2014-09-221-1/+1
| | | | | | | | | | | | | | | | | | The "ROM" and unknown probe types within the obsolete "direct-mapped" probe function used the nonexistent "mtd_rom" probe instead of the intended "map_rom". Signed-off-by: Aaron Sierra <asierra@xes-inc.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * MAINTAINERS: add l2-mtd.git, 'next' tree for MTDBrian Norris2014-09-191-0/+1
| | | | | | | | | | | | | | | | We've been semi-officially queueing patches here for a while, and it's in linux-next, so let's advertise it in MAINTAINERS. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Acked-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
| * mtd: denali: fix indents and other trivial thingsMasahiro Yamada2014-09-191-77/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Fix indents - Do not break a line unless it is longer than 80 columns - Do not insert a whitespace before ';' - Use whitespaces around operators - Use braces for a "else" block where the "if" block uses ones. Besides, eliminate all the warnings reported by checkpatch.pl: - WARNING: quoted string split across lines - WARNING: else is not generally useful after a break or return - WARNING: Missing a blank line after declarations - WARNING: Avoid line continuations in quoted strings Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: denali: remove unnecessary parenthesesMasahiro Yamada2014-09-191-7/+7
| | | | | | | | | | | | | | | | | | We should use parentheses only when they are necessary or they really improve the readability. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: denali: remove another set-but-unused variableBrian Norris2014-09-191-2/+1
| | | | | | | | | | | | | | The variable "irq_status" in denali_read_page_raw() is set, but not used. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: denali: fix include guard and license block of denali.hMasahiro Yamada2014-09-171-23/+4
| | | | | | | | | | | | | | | | | | | | It looks like this header file is a concatenation of two headers. Anyway, the include guard should be renamed and placed at the correct postion and the license block in the middle should be deleted. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: nand: don't break long print messagesRafał Miłecki2014-09-172-22/+15
| | | | | | | | | | | | | | | | | | This follows Chapter 2 of Linux's CodingStyle: > However, never break user-visible strings such as printk messages, > because that breaks the ability to grep for them. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: bcm47xxnflash: replace some magic numbersRafał Miłecki2014-09-171-4/+6
| | | | | | | | | | Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: bcm47xxnflash: NAND_CMD_RESET supportRafał Miłecki2014-09-171-1/+5
| | | | | | | | | | Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: bcm47xxnflash: add cmd_ctrl handlerRafał Miłecki2014-09-171-0/+21
| | | | | | | | | | | | | | | | This won't be used by NAND subsystem as we implement cmdfunc on our own, but will allow us to write a bit cleaner code. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: bcm47xxnflash: add dev_ready and fill chip_delayRafał Miłecki2014-09-171-0/+12
| | | | | | | | | | Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: bcm47xxnflash: fix typo in freq calculationRafał Miłecki2014-09-171-3/+5
| | | | | | | | | | | | | | We are supposed to mask value, not multiply it. Add some comments btw. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: bcm47xxpart: find NVRAM partitions in middle blocksRafał Miłecki2014-09-171-0/+11
| | | | | | | | | | | | | | | | | | | | | | Old devices used to have NVRAM at the very end of flash and they could be unaligned (starting at some offset in a block). In new devices NVRAM can be located quite randomly, however it seems to always start at the beginning of a block. For example Netgear R6250 has NVRAM located right after the bootloader, before the kernel partition. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: atmel_nand: remove pmecc_bytes_per_sector, use chip->ecc.bytes insteadWu, Josh2014-09-171-8/+5
| | | | | | | | | | | | | | | | For PMECC, the pmecc_bytes_per_sector has same meaning as ecc.bytes. So remove pmecc_bytes_per_sector and use ecc.bytes instead. Signed-off-by: Josh Wu <josh.wu@atmel.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: atmel_nand: remove pmecc_sector_number, use ecc.steps insteadWu, Josh2014-09-171-8/+6
| | | | | | | | | | | | | | | | For PMECC, the pmecc_sector_number has same meaning as ecc.steps. So use ecc.steps to replace the pmecc_sector_number. Signed-off-by: Josh Wu <josh.wu@atmel.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * nand: omap2: Add support for flash-based bad block tableEzequiel García2014-09-173-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds a new platform-data boolean property that enables use of a flash-based bad block table. This can also be enabled by setting the 'nand-on-flash-bbt' devicetree property. If the flash BBT is not enabled, the driver falls back to use OOB bad block markers only, as before. If the flash BBT is enabled the kernel will keep track of bad blocks using a BBT, in addition to the OOB markers. As explained by Brian Norris the reasons for using a BBT are: "" The primary reason would be that NAND datasheets specify it these days. A better argument is that nobody guarantees that you can write a bad block marker to a worn out block; you may just get program failures. This has been acknowledged by several developers over the last several years. Additionally, you get a boot-time performance improvement if you only have to read a few pages, instead of a page or two from every block on the flash. "" Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Acked-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: nand: atmel_nand: retrieve NFC clockBoris BREZILLON2014-09-172-0/+27
| | | | | | | | | | | | | | | | | | | | | | Retrieve the NFC clock to make sure it is enabled. Make that optional to ensure compatibility with previous device trees but document it as mandatory so newer device trees will include it. Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Acked-by: Josh Wu <josh.wu@atmel.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: denali: remove a set-but-unused variableMasahiro Yamada2014-09-151-2/+0
| | | | | | | | | | | | | | | | The variable "retry" in wait_for_irq() is set, but not used. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: denali: change the type of iterators to intMasahiro Yamada2014-09-151-4/+7
| | | | | | | | | | | | | | We should rathar use "int" type for loop iterators. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: denali: remove unnecessary castsMasahiro Yamada2014-09-151-18/+18
| | | | | | | | | | | | | | Useless casts result in unreadable source code. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: denali: remove unnecessary variable initializationsMasahiro Yamada2014-09-151-32/+27
| | | | | | | | | | | | | | | | | | All of these variables are initialized to zero and then set to a different value below. Zero-initializing is redundant. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: denali: fix the format of comment blocksMasahiro Yamada2014-09-151-123/+188
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We should use /* * Blah Blah ... * ... */ for multi-line comment blocks. In addition, refactor some comments where it seems reasonable and remove some comments where the code is clear enough such as: /* clear interrupts */ clear_interrupts(denali); Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * Merge tag 'v3.17-rc5' from upstreamBrian Norris2014-09-15980-5534/+10963
| |\
| * \ Merge l2-mtd/next into l2-mtd/masterBrian Norris2014-08-199922-580925/+559035
| |\ \
| | * | mtd: spi-nor: drop jedec_probe /helper/ functionRafał Miłecki2014-08-191-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's a one-liner doing no magic and its name may be confusing because it does not have to use JEDEC (e.g. when using alternative read_id). Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Acked-by: Huang Shijie <shijie8@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| | * | mtd: spi-nor: remove duplicated w25q128 entryRafał Miłecki2014-08-191-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Acked-by: Huang Shijie <shijie8@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| | * | mtd: gpio_flash: handle case where offset + len exceeds the window sizeAaron Wu2014-08-191-14/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the bug in handling gpio flash read/write when offset + len from MTD exceeds the window size Signed-off-by: Aaron Wu <Aaron.wu@analog.com> [Brian: made some commentary edits. Also note that the BUG_ON() was provably false for all non-negative inputs (since x % y <= x), so we dropped it.] Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| | * | mtd: nand: Use ULL-suffix for big u64 constantGeert Uytterhoeven2014-08-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | drivers/mtd/nand/nand_timings.c:45: warning: integer constant is too large for ‘long’ type [ Editorial note: This is a false warning. Looking at ISO draft N1124 (this is approximately C11, the first PDF I had lying around), section 6.4.4.1 (statement 5): "The type of an integer constant is the first of the corresponding list in which its value can be represented." So this should not be an overflow, and any toolchain that says so (e.g., GCC 4.4) is buggy. -Brian ] Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| | * | mtd: atmel_nand: NFC: fix mtd_nandbiterrs.ko test fail when using sram writeWu, Josh2014-08-191-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When enable NFC sram write, it will failed the mtd_nandbiterrs.ko test. As in driver's nfc_sram_write_page(), if ops->mode equal to MTD_OSP_RAW, driver assumes the data buffer contains one page data and one oob data followed. And driver will write the page data and oob data to nand. But this is wrong implementation. Since the data buffer don't contains the oob data to write. We should write the chip->oob_poi to nand's oob. So this patch fix it by writing the oob data from chip->oob_poi. Signed-off-by: Josh Wu <josh.wu@atmel.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| | * | mtd: terminate user-provided stringBrian Norris2014-08-191-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Noticed by Coverity as a potential security issue. Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| | * | mtd: nand: fix integer widening problemsBrian Norris2014-08-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | chip->pagebuf is a 32-bit type (int), so the shift will only be applied as 32-bit. Fix this for 64-bit safety. Caught by Coverity. Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| | * | mtd: maps: solutionengine: drop excess dependencyBrian Norris2014-08-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Already depends on SOLUTION_ENGINE, so we don't need the SUPERH dependency too. Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| | * | mtd: nandsim: fix integer wideningBrian Norris2014-08-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This multiplication should be done in 64-bit, not 32-bit. Caught by Coverity. Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| | * | mtd: nand: denali: set proper error code on timeoutBrian Norris2014-08-191-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The condition "if (irq_status == 0)" already ensures that one half of the ternary ?: is dead. I think this should probably actually be a FAIL, not a PASS. Caught by Coverity. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Cc: Jamie Iles <jamie@jamieiles.com>
| | * | mtd: use __packed shorthandBrian Norris2014-08-193-13/+13
| | | | | | | | | | | | | | | | Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| | * | mtd: tests: fix integer overflow issuesBrian Norris2014-08-197-22/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These multiplications are done with 32-bit arithmetic, then converted to 64-bit. We should widen the integers first to prevent overflow. This could be a problem for large (>4GB) MTD's. Detected by Coverity. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Cc: Akinobu Mita <akinobu.mita@gmail.com>
| | * | mtd: mtdswap: fix integer overflowBrian Norris2014-08-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Caught by Coverity. Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| | * | mtd: remove dead non-char logicBrian Norris2014-08-191-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MTD used to allow compiling out character device support. This was dropped in the following commit, but some of the accompanying logic was never dropped: commit 660685d9d1b4730f0b5ca97fa95f272f99c63bce Author: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Date: Thu Mar 14 13:27:40 2013 +0200 mtd: merge mtdchar module with mtdcore The weird logic was flagged by Coverity. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Cc: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
| | * | mtd: sm_ftl: initialize error codeBrian Norris2014-08-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is one theoretical case that could fall through to using an uninitialized value as the return code. Let's give it a value of 0. Untested. Caught by Coverity. Signed-off-by: Brian Norris <computersforpeace@gmail.com>