linux/drivers/mtd/nand
Arnd Bergmann 8ff0513bdc mtd: mtk: avoid warning in mtk_ecc_encode
When building with -Wmaybe-uninitialized, gcc produces a silly false positive
warning for the mtk_ecc_encode function:

drivers/mtd/nand/mtk_ecc.c: In function 'mtk_ecc_encode':
drivers/mtd/nand/mtk_ecc.c:402:15: error: 'val' may be used uninitialized in this function [-Werror=maybe-uninitialized]

The function for some reason contains a double byte swap on big-endian
builds to get the OOB data into the correct order again, and is written
in a slightly confusing way.

Using a simple memcpy32_fromio() to read the data simplifies it a lot
so it becomes more readable and produces no warning. However, the
output might not have 32-bit alignment, so we have to use another
memcpy to avoid taking alignment faults or writing beyond the end
of the array.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Tested-by: RogerCC Lin <rogercc.lin@mediatek.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
2016-10-28 10:21:23 +02:00
..
bcm47xxnflash
brcmnand mtd: brcmnand: iProc big endian and ONFI support 2016-09-23 09:35:16 +02:00
gpmi-nand mtd: nand: gpmi: disable the clocks on errors 2016-10-28 09:58:05 +02:00
Kconfig mtd: nand: Allow MTD_NAND_OMAP2 to be usable on Keystone devices 2016-09-23 09:35:16 +02:00
Makefile mtd: mediatek: driver for MTK Smart Device 2016-07-11 08:39:54 +02:00
ams-delta.c
atmel_nand.c Revert "mtd: atmel_nand: Support variable RB_EDGE interrupts" 2016-05-25 20:06:28 -07:00
atmel_nand_ecc.h
atmel_nand_nfc.h Revert "mtd: atmel_nand: Support variable RB_EDGE interrupts" 2016-05-25 20:06:28 -07:00
au1550nd.c
bf5xx_nand.c mtd: nand: import nand_hw_control_init() 2016-09-23 09:35:16 +02:00
cafe_nand.c
cmx270_nand.c
cs553x_nand.c
davinci_nand.c mtd: nand: davinci: Reinitialize the HW ECC engine in 4bit hwctl 2016-09-09 19:39:33 -07:00
denali.c
denali.h
denali_dt.c
denali_pci.c
diskonchip.c
docg4.c mtd: nand: import nand_hw_control_init() 2016-09-23 09:35:16 +02:00
fsl_elbc_nand.c mtd: nand: import nand_hw_control_init() 2016-09-23 09:35:16 +02:00
fsl_ifc_nand.c mtd: nand: import nand_hw_control_init() 2016-09-23 09:35:16 +02:00
fsl_upm.c
fsmc_nand.c mtd: mtd: drop NAND_ECC_SOFT_BCH enum value 2016-05-05 23:55:13 +02:00
gpio.c
hisi504_nand.c
jz4740_nand.c
jz4780_bch.c mtd: nand: jz4780: Update MODULE_AUTHOR email address 2016-07-11 08:40:19 +02:00
jz4780_bch.h
jz4780_nand.c mtd: nand: import nand_hw_control_init() 2016-09-23 09:35:16 +02:00
lpc32xx_mlc.c
lpc32xx_slc.c
mpc5121_nfc.c
mtk_ecc.c mtd: mtk: avoid warning in mtk_ecc_encode 2016-10-28 10:21:23 +02:00
mtk_ecc.h mtd: mediatek: driver for MTK Smart Device 2016-07-11 08:39:54 +02:00
mtk_nand.c mtd: nand: fix chances to create incomplete ECC data when writing 2016-09-19 11:57:04 +02:00
mxc_nand.c MTD updates for 4.9-rc1 2016-10-10 17:39:51 -07:00
nand_base.c mtd: nand: Fix data interface configuration logic 2016-10-28 09:58:36 +02:00
nand_bbt.c mtd: nand_bbt: scan for next free bbt block if writing bbt fails 2016-09-23 09:35:16 +02:00
nand_bch.c mtd: nand_bch: fix spelling of "probably" 2016-05-06 09:45:45 -07:00
nand_ecc.c
nand_ids.c mtd: nand: add ESMT manufacturer 2016-06-09 21:23:20 +02:00
nand_timings.c mtd: nand: Expose data interface for ONFI mode 0 2016-09-23 09:35:16 +02:00
nandsim.c MTD updates for v4.7: 2016-05-24 11:00:20 -07:00
ndfc.c mtd: nand: import nand_hw_control_init() 2016-09-23 09:35:16 +02:00
nuc900_nand.c
omap2.c mtd: nand: omap2: Don't call dma_release_channel() if dma_request_chan() failed 2016-08-29 12:54:39 -07:00
omap_elm.c
orion_nand.c
pasemi_nand.c
plat_nand.c
pxa3xx_nand.c mtd: nand: import nand_hw_control_init() 2016-09-23 09:35:16 +02:00
qcom_nandc.c mtd: nand: import nand_hw_control_init() 2016-09-23 09:35:16 +02:00
r852.c
r852.h
s3c2410.c mtd: nand: s3c2410: Register cpufreq notifier only on S3C24xx 2016-09-23 09:35:16 +02:00
sh_flctl.c mtd: nand: sh_flctl: handle dma_submit() errors 2016-09-23 09:35:16 +02:00
sharpsl.c
sm_common.c
sm_common.h
socrates_nand.c
sunxi_nand.c mtd: nand: sunxi: Support ECC maximization 2016-09-23 09:35:16 +02:00
tmio_nand.c
txx9ndfmc.c mtd: nand: import nand_hw_control_init() 2016-09-23 09:35:16 +02:00
vf610_nfc.c
xway_nand.c mtd: nand: xway: add nandaddr to own struct 2016-07-11 08:40:17 +02:00