Searched hist:"300 aab2ac13af6f60ecc5d02fc13aeef614e7d66" (Results 1 – 1 of 1) sorted by relevance
| /rk3399_rockchip-uboot/drivers/mtd/ |
| H A D | mtdcore.c | 300aab2ac13af6f60ecc5d02fc13aeef614e7d66 Thu Aug 16 15:30:01 UTC 2018 Boris Brezillon <boris.brezillon@free-electrons.com> UPSTREAM: mtd: Add sanity checks in mtd_write/read_oob()
Unlike what's done in mtd_read/write(), there are no checks to make sure the parameters passed to mtd_read/write_oob() are consistent, which forces implementers of ->_read/write_oob() to do it, which in turn leads to code duplication and possibly errors in the logic.
Do general sanity checks, like ops fields consistency and range checking.
Change-Id: Ibe2de07dfd3d7504d615b1c22cdcb34c79eca63e Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Cc: Peter Pan <peterpandong@micron.com> Signed-off-by: Richard Weinberger <richard@nod.at> [Miquel: squashed the fix about the chip's size check] Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit 8fad769f1eab88a2bcf0b714694158968f58715a)
|