mtd: jz4780_nand: replace if/else blocks with switch/case
Using switch/case helps make this logic more clear and more robust. With
this structure:
* it's clear that this driver only support ECC_{HW,SOFT,SOFT_BCH}; and
* we can sanely handle new ECC unsupported modes (right now, this code
makes incorrect assumptions about the possible values in the
nand_ecc_modes_t enum; e.g., what happens with NAND_ECC_HW_OOB_FIRST?)
Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
Cc: Alex Smith <alex@alex-smith.me.uk>
Reviewed-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
Tested-by: NHarvey Hunt <harvey.hunt@imgtec.com>
Acked-by: NHarvey Hunt <harvey.hunt@imgtec.com>
Showing
想要评论请 注册 或 登录