[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK7LNASsn8esF6UsCmc-Pv+ED_ukvtMO7nOWLs+u6H0UgcsHTw@mail.gmail.com>
Date: Wed, 30 Nov 2016 15:20:10 +0900
From: Masahiro Yamada <yamada.masahiro@...ionext.com>
To: Boris Brezillon <boris.brezillon@...e-electrons.com>
Cc: linux-mtd@...ts.infradead.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Marek Vasut <marek.vasut@...il.com>,
Brian Norris <computersforpeace@...il.com>,
Richard Weinberger <richard@....at>,
David Woodhouse <dwmw2@...radead.org>,
Cyrille Pitchen <cyrille.pitchen@...el.com>
Subject: Re: [PATCH 17/39] mtd: nand: denali: support HW_ECC_FIXUP capability
Hi Boris,
2016-11-28 1:09 GMT+09:00 Boris Brezillon <boris.brezillon@...e-electrons.com>:
&max_bitflips);
>
> Okay, so you currently have two ways of handling ECC errors. What if a
> new revision introduces yet another way to do it?
>
> How about making denali_caps a structure where you have one (or several)
> function pointers to implement operations differently depending on the
> IP revision?
>
> struct denali_caps {
> u32 feature_flags; /* If needed. */
> bool (*handle_ecc)(...);
> ...
> };
>
I think a problem is the difference of function arguments:
static bool denali_hw_ecc_fixup(struct denali_nand_info *denali,
unsigned int *max_bitflips)
vs
static bool denali_sw_ecc_fixup(struct denali_nand_info *denali, u8 *buf,
u32 irq_status, unsigned int *max_bitflips)
I do not want to pass redundant arguments,
which are used for one, but not used for the other.
We do not need to think about the situation that may not happen.
If happens, we can refactor the code any time.
--
Best Regards
Masahiro Yamada
Powered by blists - more mailing lists