mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-28 04:17:47 +00:00
8ff0513bdc
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> |
||
---|---|---|
.. | ||
bcm47xxnflash | ||
brcmnand | ||
gpmi-nand | ||
ams-delta.c | ||
atmel_nand_ecc.h | ||
atmel_nand_nfc.h | ||
atmel_nand.c | ||
au1550nd.c | ||
bf5xx_nand.c | ||
cafe_nand.c | ||
cmx270_nand.c | ||
cs553x_nand.c | ||
davinci_nand.c | ||
denali_dt.c | ||
denali_pci.c | ||
denali.c | ||
denali.h | ||
diskonchip.c | ||
docg4.c | ||
fsl_elbc_nand.c | ||
fsl_ifc_nand.c | ||
fsl_upm.c | ||
fsmc_nand.c | ||
gpio.c | ||
hisi504_nand.c | ||
jz4740_nand.c | ||
jz4780_bch.c | ||
jz4780_bch.h | ||
jz4780_nand.c | ||
Kconfig | ||
lpc32xx_mlc.c | ||
lpc32xx_slc.c | ||
Makefile | ||
mpc5121_nfc.c | ||
mtk_ecc.c | ||
mtk_ecc.h | ||
mtk_nand.c | ||
mxc_nand.c | ||
nand_base.c | ||
nand_bbt.c | ||
nand_bch.c | ||
nand_ecc.c | ||
nand_ids.c | ||
nand_timings.c | ||
nandsim.c | ||
ndfc.c | ||
nuc900_nand.c | ||
omap2.c | ||
omap_elm.c | ||
orion_nand.c | ||
pasemi_nand.c | ||
plat_nand.c | ||
pxa3xx_nand.c | ||
qcom_nandc.c | ||
r852.c | ||
r852.h | ||
s3c2410.c | ||
sh_flctl.c | ||
sharpsl.c | ||
sm_common.c | ||
sm_common.h | ||
socrates_nand.c | ||
sunxi_nand.c | ||
tmio_nand.c | ||
txx9ndfmc.c | ||
vf610_nfc.c | ||
xway_nand.c |