mtd: rawnand: nandsim: Merge repeat codes in ns_switch_state
authorRinHizakura <s921975628@gmail.com>
Sat, 25 Dec 2021 10:06:48 +0000 (18:06 +0800)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Sun, 23 Jan 2022 15:37:05 +0000 (16:37 +0100)
commitdb52b445793d8e4ffe9b53ff749a55470b900984
tree2d1168938613e900127dd45a88f21f00298eb38e
parente0a9ddd5d9e1c66caefda825b3cea8ea9bd21bf0
mtd: rawnand: nandsim: Merge repeat codes in ns_switch_state

The moving block of codes is shared between both 'if' and 'else' condition,
we can move it out to reduce the duplication.

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/20211225100648.119011-1-s921975628@gmail.com
drivers/mtd/nand/raw/nandsim.c