Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1533040

Re: [PATCH 17/39] mtd: nand: denali: support HW_ECC_FIXUP capability

From Boris Brezillon <boris.brezillon@free-electrons.com>
Newsgroups linux.kernel
Subject Re: [PATCH 17/39] mtd: nand: denali: support HW_ECC_FIXUP capability
Date 2016-11-30 09:00 +0100
Message-ID <sJ7Y6-3eC-9@gated-at.bofh.it> (permalink)
References <sHPAd-1yq-5@gated-at.bofh.it> <sHPAd-1yq-17@gated-at.bofh.it> <sIabD-6uR-1@gated-at.bofh.it> <sJ6yZ-2x2-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, 30 Nov 2016 15:20:10 +0900
Masahiro Yamada <yamada.masahiro@socionext.com> wrote:

> Hi Boris,
> 
> 
> 2016-11-28 1:09 GMT+09:00 Boris Brezillon <boris.brezillon@free-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 that all the time when defining generic interfaces.

> 
> We do not need to think about the situation that may not happen.
> If happens, we can refactor the code any time.
> 

Well, as I said in my other reply, I still think it's better to plan
for this now, rather than having to change a lot things when we appear
to need this. But that's only my POV, and I don't care enough to fight.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 17/39] mtd: nand: denali: support HW_ECC_FIXUP capability Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-26 19:10 +0100
  Re: [PATCH 17/39] mtd: nand: denali: support HW_ECC_FIXUP  capability Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-11-27 17:10 +0100
    Re: [PATCH 17/39] mtd: nand: denali: support HW_ECC_FIXUP capability Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-30 07:30 +0100
      Re: [PATCH 17/39] mtd: nand: denali: support HW_ECC_FIXUP  capability Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-11-30 09:00 +0100

csiph-web