linux-stable/drivers/mtd/nand/raw
Jason A. Donenfeld e8a533cbeb treewide: use get_random_u32_inclusive() when possible
These cases were done with this Coccinelle:

@@
expression H;
expression L;
@@
- (get_random_u32_below(H) + L)
+ get_random_u32_inclusive(L, H + L - 1)

@@
expression H;
expression L;
expression E;
@@
  get_random_u32_inclusive(L,
  H
- + E
- - E
  )

@@
expression H;
expression L;
expression E;
@@
  get_random_u32_inclusive(L,
  H
- - E
- + E
  )

@@
expression H;
expression L;
expression E;
expression F;
@@
  get_random_u32_inclusive(L,
  H
- - E
  + F
- + E
  )

@@
expression H;
expression L;
expression E;
expression F;
@@
  get_random_u32_inclusive(L,
  H
- + E
  + F
- - E
  )

And then subsequently cleaned up by hand, with several automatic cases
rejected if it didn't make sense contextually.

Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> # for infiniband
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2022-11-18 02:18:02 +01:00
..
atmel mtd: rawnand: atmel: Unmap streaming DMA mappings 2022-09-21 10:38:46 +02:00
bcm47xxnflash mtd: rawnand: bcm47xx: fix spelling typo in comment 2022-09-21 10:38:47 +02:00
brcmnand mtd: rawnand: brcmnand: Add individual glue driver selection 2022-09-21 10:38:46 +02:00
gpmi-nand mtd: rawnand: gpmi: Fix typo 'the the' in comment 2022-09-21 10:38:46 +02:00
ingenic SPI NOR core changes: 2022-03-18 20:14:42 +01:00
Kconfig mtd: rawnand: meson: stop supporting legacy clocks 2022-09-21 10:38:47 +02:00
Makefile mtd: nand: make mtk_ecc.c a separated module 2022-04-27 18:12:35 +02:00
ams-delta.c mtd: rawnand: ams-delta: Keep the driver compatible with on-die ECC engines 2021-10-15 12:21:14 +02:00
arasan-nand-controller.c mtd: rawnand: arasan: stop using 0 as NULL pointer 2022-09-21 10:38:46 +02:00
au1550nd.c mtd: rawnand: au1550nd: Keep the driver compatible with on-die ECC engines 2021-10-15 12:21:16 +02:00
cadence-nand-controller.c mtd: rawnand: cadence: Remove an unneeded result variable 2022-09-21 10:38:47 +02:00
cafe_nand.c mtd: rawnand: cafe: Use correct function name in comment block 2022-09-21 10:38:46 +02:00
cs553x_nand.c mtd: rawnand: cs553x: simplify the return expression of cs553x_write_ctrl_byte() 2022-05-12 16:43:03 +02:00
davinci_nand.c mtd: rawnand: davinci: Remove redundant unsigned comparison to zero 2022-04-04 10:34:46 +02:00
denali.c
denali.h
denali_dt.c mtd: rawnand: denali: Make use of the helper function devm_platform_ioremap_resource_byname() 2021-09-14 19:34:34 +02:00
denali_pci.c mtd: rawnand: denali: Use managed device resources 2022-04-21 09:34:00 +02:00
diskonchip.c
fsl_elbc_nand.c mtd: rawnand: fsl_elbc: Fix none ECC mode 2022-09-20 10:06:59 +02:00
fsl_ifc_nand.c
fsl_upm.c
fsmc_nand.c mtd: rawnand: fsmc: Fix timing computation 2021-12-03 14:33:45 +01:00
gpio.c mtd: rawnand: gpio: Keep the driver compatible with on-die ECC engines 2021-10-15 12:21:18 +02:00
hisi504_nand.c mtd: rawnand: hisi504: Make use of the helper function devm_platform_ioremap_resource() 2021-09-14 19:34:41 +02:00
intel-nand-controller.c mtd: rawnand: intel: Add missing of_node_put() in ebu_nand_probe() 2022-10-18 10:28:15 +02:00
internals.h mtd: rawnand: Choose the best timings, NV-DDR included 2021-05-26 10:52:43 +02:00
lpc32xx_mlc.c
lpc32xx_slc.c Revert "mtd: rawnand: lpc32xx_slc: Fix external use of SW Hamming ECC helper" 2021-10-15 12:21:09 +02:00
marvell_nand.c mtd: rawnand: marvell: Use correct logic for nand-keep-config 2022-10-18 10:31:00 +02:00
meson_nand.c mtd: rawnand: meson: refine resource getting in probe 2022-09-21 10:38:47 +02:00
mpc5121_nfc.c mtd: rawnand: mpc5121: Check before clk_disable_unprepare() not needed 2022-05-16 18:34:38 +02:00
mtk_nand.c mtd: nand: make mtk_ecc.c a separated module 2022-04-27 18:12:35 +02:00
mxc_nand.c mtd: rawnand: mxc: Remove unneeded of_match_ptr() 2021-03-28 19:13:39 +02:00
mxic_nand.c
nand_amd.c
nand_base.c Raw NAND core changes: 2022-10-07 16:56:14 +02:00
nand_bbt.c mtd: always initialize 'stats' in struct mtd_oob_ops 2022-09-21 10:38:07 +02:00
nand_esmt.c
nand_hynix.c mtd: rawnand: hynix: Add support for H27UCG8T2ETR-BC MLC NAND 2021-10-15 12:24:50 +02:00
nand_ids.c Revert "mtd: rawnand: add support for Toshiba TC58NVG0S3HTA00 NAND flash" 2022-06-09 15:07:07 +02:00
nand_jedec.c
nand_legacy.c mtd: rawnand: Avoid accessing NV-DDR timings from legacy code 2021-05-26 10:43:52 +02:00
nand_macronix.c
nand_micron.c
nand_onfi.c mtd: rawnand: onfi: Fix endianness when reading NV-DDR values 2021-06-18 09:45:20 +02:00
nand_samsung.c
nand_timings.c mtd: rawnand: Add a helper to find the closest ONFI NV-DDR mode 2021-05-26 10:43:59 +02:00
nand_toshiba.c mtd: rawnand: kioxia: Add support for TH58NVG3S0HBAI4 2022-05-12 16:43:01 +02:00
nandsim.c treewide: use get_random_u32_inclusive() when possible 2022-11-18 02:18:02 +01:00
ndfc.c Revert "mtd: rawnand: ndfc: Fix external use of SW Hamming ECC helper" 2021-10-15 12:21:07 +02:00
omap2.c mtd: rawnand: omap2: Suppress error message after WARN in .remove() 2022-06-09 15:06:21 +02:00
omap_elm.c mtd: rawnand: omap_elm: Add compatible for AM64 ELM 2022-04-11 10:56:33 +02:00
orion_nand.c mtd: rawnand: orion: Use devm_clk_get_optional() 2022-09-21 10:38:46 +02:00
oxnas_nand.c mtd: rawnand: oxnas: Make use of the helper function devm_platform_ioremap_resource() 2021-09-14 19:34:51 +02:00
pasemi_nand.c mtd: rawnand: pasemi: Keep the driver compatible with on-die ECC engines 2021-10-15 12:21:24 +02:00
pl35x-nand-controller.c mtd: rawnand: pl353: Set the nand chip node as the flash node 2022-02-18 15:14:58 +01:00
plat_nand.c mtd: rawnand: plat_nand: Keep the driver compatible with on-die ECC engines 2021-10-15 12:21:26 +02:00
qcom_nandc.c mtd: nand: raw: qcom_nandc: add support for unprotected spare data pages 2022-06-17 08:30:19 +02:00
r852.c mtd: rawnand: r852: use DEVICE_ATTR_RO() helper macro 2021-06-18 09:45:21 +02:00
r852.h
renesas-nand-controller.c mtd: rawnand: renesas: Use runtime PM instead of the raw clock API 2022-05-16 18:36:21 +02:00
rockchip-nand-controller.c mtd: rawnand: rockchip: Check before clk_disable_unprepare() not needed 2022-05-16 18:34:36 +02:00
s3c2410.c
sh_flctl.c mtd: rawnand: Fix return value check of wait_for_completion_timeout 2022-04-21 09:29:03 +02:00
sharpsl.c block: remove genhd.h 2022-02-02 07:49:59 -07:00
sm_common.c mtd: always initialize 'stats' in struct mtd_oob_ops 2022-09-21 10:38:07 +02:00
sm_common.h
socrates_nand.c mtd: rawnand: socrates: Keep the driver compatible with on-die ECC engines 2021-10-15 12:21:29 +02:00
stm32_fmc2_nand.c mtd: rawnand: stm32_fmc2: switch to using devm_fwnode_gpiod_get() 2022-09-21 10:38:47 +02:00
sunxi_nand.c mtd: rawnand: sunxi: remove unnecessary oom message 2021-06-11 20:43:33 +02:00
tegra_nand.c mtd: rawnand: tegra: Fix PM disable depth imbalance in probe 2022-10-18 10:29:39 +02:00
tmio_nand.c mtd: rawnand: tmio: check return value after calling platform_get_resource() 2022-04-27 17:15:09 +02:00
txx9ndfmc.c Revert "mtd: rawnand: txx9ndfmc: Fix external use of SW Hamming ECC helper" 2021-10-15 12:21:01 +02:00
vf610_nfc.c mtd: rawnand: vf610: Make use of the helper function devm_platform_ioremap_resource() 2021-09-14 19:35:03 +02:00
xway_nand.c mtd: rawnand: xway: Keep the driver compatible with on-die ECC engines 2021-10-15 12:21:31 +02:00