[PATCH] mtd: jz4780_nand: replace if/else blocks with switch/case
Boris Brezillon
boris.brezillon at free-electrons.com
Fri Jan 8 04:41:31 PST 2016
On Fri, 8 Jan 2016 12:30:32 +0000
Harvey Hunt <harvey.hunt at imgtec.com> wrote:
> Hi,
>
> On 08/01/16 12:28, Boris Brezillon wrote:
> > On Thu, 7 Jan 2016 09:53:08 -0800
> > Brian Norris <computersforpeace at gmail.com> wrote:
> >
> >> 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 at gmail.com>
> >> Cc: Alex Smith <alex at alex-smith.me.uk>
> >> Cc: Harvey Hunt <harvey.hunt at imgtec.com>
> >
> > LGTM
> >
> > Reviewed-by: Boris Brezillon <boris.brezillon at free-electrons.com>
> >
>
> If it helps, I can add my Tested-By later today?
Yes, that would be good, I only reviewed the changes, a real test would
confirm it does not break anything.
--
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
More information about the linux-mtd
mailing list