mtd: rawnand: nandsim: Replace overflow check with kzalloc to single kcalloc
authorRinHizakura <s921975628@gmail.com>
Sat, 25 Dec 2021 10:06:07 +0000 (18:06 +0800)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Sun, 23 Jan 2022 15:37:04 +0000 (16:37 +0100)
commite0a9ddd5d9e1c66caefda825b3cea8ea9bd21bf0
tree095342bc10427c6fc0fba60f302c64bad6c990d2
parente783362eb54cd99b2cac8b3a9aeac942e6f6ac07
mtd: rawnand: nandsim: Replace overflow check with kzalloc to single kcalloc

Instead of self-checking overflow and allocating an array of specific size
by counting the total required space handy, we already have existed kernel
API which responses for all these works.

Signed-off-by: RinHizakura <s921975628@gmail.com>
Reviewed-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20211225100607.118932-1-s921975628@gmail.com
drivers/mtd/nand/raw/nandsim.c