Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933139AbdCaJJp (ORCPT ); Fri, 31 Mar 2017 05:09:45 -0400 Received: from mail.free-electrons.com ([62.4.15.54]:35654 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932582AbdCaJJl (ORCPT ); Fri, 31 Mar 2017 05:09:41 -0400 Date: Fri, 31 Mar 2017 11:09:38 +0200 From: Boris Brezillon To: Masahiro Yamada Cc: linux-mtd@lists.infradead.org, Enrico Jorns , Artem Bityutskiy , Dinh Nguyen , Marek Vasut , Graham Moore , David Woodhouse , Masami Hiramatsu , Chuanxiao Dong , Jassi Brar , linux-kernel@vger.kernel.org, Brian Norris , Richard Weinberger , Cyrille Pitchen Subject: Re: [PATCH v3 13/37] mtd: nand: denali: avoid hard-coding ecc.strength and ecc.bytes Message-ID: <20170331110938.071cd993@bbrezillon> In-Reply-To: <1490856383-31560-14-git-send-email-yamada.masahiro@socionext.com> References: <1490856383-31560-1-git-send-email-yamada.masahiro@socionext.com> <1490856383-31560-14-git-send-email-yamada.masahiro@socionext.com> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 669 Lines: 27 On Thu, 30 Mar 2017 15:45:59 +0900 Masahiro Yamada wrote: > > diff --git a/drivers/mtd/nand/denali_dt.c b/drivers/mtd/nand/denali_dt.c > index 1681a30..c3bc333 100644 > --- a/drivers/mtd/nand/denali_dt.c > +++ b/drivers/mtd/nand/denali_dt.c > @@ -31,10 +31,12 @@ struct denali_dt { > > struct denali_dt_data { > unsigned int revision; > + unsigned long ecc_strength_avail; Shouldn't you directly make sure that your driver will support strengths > BITS_PER_LONG? I would store the supported strength in a table to make it more future-proof: int *ecc_strength_avail; int num_ecc_strengths; > unsigned int caps; > }; >