linux-stable/drivers/mtd/nand
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
..
onenand mtd: add ECC error accounting for each read request 2022-09-21 10:38:09 +02:00
raw treewide: use get_random_u32_inclusive() when possible 2022-11-18 02:18:02 +01:00
spi mtd: add ECC error accounting for each read request 2022-09-21 10:38:09 +02:00
Kconfig mtd: nand: MTD_NAND_ECC_MEDIATEK should depend on ARCH_MEDIATEK 2022-05-12 16:43:04 +02:00
Makefile mtd: nand: make mtk_ecc.c a separated module 2022-04-27 18:12:35 +02:00
bbt.c mtd: nand: bbt: Use the bitmap API to allocate bitmaps 2022-09-20 10:06:58 +02:00
core.c Topic branch bringing-in changes related to the support of ECC engines 2022-02-18 15:11:12 +01:00
ecc-mtk.c MTD core changes: 2022-05-24 14:31:29 -07:00
ecc-mxic.c mtd: nand: mxic-ecc: make two read-only arrays static const 2022-03-14 17:01:58 +01:00
ecc-sw-bch.c mtd: nand: ecc-bch: Use the public nsteps field 2021-03-11 09:37:28 +01:00
ecc-sw-hamming.c mtd: rawnand: Let callers use the bare Hamming helpers 2021-10-15 12:20:59 +02:00
ecc.c mtd: nand: ecc: Provide a helper to retrieve a pilelined engine device 2022-02-09 09:49:36 +01:00