]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
mtd: jz4780_nand: replace if/else blocks with switch/case
authorBrian Norris <computersforpeace@gmail.com>
Thu, 7 Jan 2016 17:53:08 +0000 (09:53 -0800)
committerBrian Norris <computersforpeace@gmail.com>
Fri, 8 Jan 2016 17:49:03 +0000 (09:49 -0800)
commit9146cbd52b11d4ade62dba8f238ec5e421c3fa2b
tree016de373e49a6af84e52e96e7f3cb6b52e27a403
parent6c1207b5b8422cdddf467b9fbef922c4c374d382
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: Brian Norris <computersforpeace@gmail.com>
Cc: Alex Smith <alex@alex-smith.me.uk>
Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Tested-by: Harvey Hunt <harvey.hunt@imgtec.com>
Acked-by: Harvey Hunt <harvey.hunt@imgtec.com>
drivers/mtd/nand/jz4780_nand.c