Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3147890pxk; Mon, 28 Sep 2020 09:27:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6jG/ok3whH9mpEVNxtfYqeVhGeh3BKPRIxiIzIKzNFs2BmSSVk4o6rQ5yyYlU2bg80rn+ X-Received: by 2002:aa7:dd11:: with SMTP id i17mr2630650edv.170.1601310455487; Mon, 28 Sep 2020 09:27:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601310455; cv=none; d=google.com; s=arc-20160816; b=jsq0ib5gHfaeVmnNFMKb+ZPOHADnEnjGvt3mYajuQQr4uTgrL/3KlTRyhX/EPOUtC0 MhwXpV/TqL1Se9zRxDx4wQOp8IRsiJn9U7I3EPIo+MT+duwi1QQU0DgfKlwKFYqt1Bhx lkEL65toLt1BDyUoG1xmNUGohwKvUbWseZQfnIiXDe4fmlxHdAzKj14p1pJV6cVXLlEg 0erUJ1CLcpk3V8g+VU/+I4Zk32my6oKMMGSqA1o/lfMorXEnUY6tlkkV/KplY0ypdn4l QigwZrOI+RRoc00+XNwMazYd13Y4QtTP0rW68zyo92lh49X7nBOErGlPFuszF3vAUf8v d52A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=2VUsPfE9u3wkrhHh6p/ZhPkK/qwq1Uwy4LksGEupx5Y=; b=Ifyy/KZXOVccG12HbBUW6UPn+iHWVLM5TaS4mB0HFM44NkxQA1CQeDWzNSNZJZTK0U qUcgxtF9faPC51aH5lT28uh21mBrZ1nhoXcxyyxda4DpS0nEpJWivlbhWPTG+YagLQ5H buBIZ5RdL9xlk6keqv2t50+Cre8TAoOF7SajJk/FymW4MBOH6cjDZ8MKM6//rms5vlx2 /YDvRPKtcfBV22NA57BMbkQZCBtaFw6xAW3or9RxITgAeaRNmy3NQ4gTnxZG8gUnJX5o q09XIcwVcWR2mPPwM/p/EuqSTNIJBqJzt8NcQ5Au1wxUupxbSwSLN7tdfvMhleA6yVNM xEyQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i3si942048eds.570.2020.09.28.09.27.12; Mon, 28 Sep 2020 09:27:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726608AbgI1QZx (ORCPT + 99 others); Mon, 28 Sep 2020 12:25:53 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:49516 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726344AbgI1QZw (ORCPT ); Mon, 28 Sep 2020 12:25:52 -0400 Received: from localhost (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 3F4AA29AD51; Mon, 28 Sep 2020 17:25:49 +0100 (BST) Date: Mon, 28 Sep 2020 18:25:45 +0200 From: Boris Brezillon To: Miquel Raynal Cc: Thirumalesha N , Richard Weinberger , Vignesh Raghavendra , Shivamurthy Shastri , Chuanhong Guo , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 1/2] mtd: spinand: micron: Generalize the function and structure names Message-ID: <20200928182545.1e972f3b@collabora.com> In-Reply-To: <20200928182159.5a6cf46a@xps13> References: <20200913161533.10655-1-nthirumalesha7@gmail.com> <20200913161533.10655-2-nthirumalesha7@gmail.com> <20200915101321.1afa5033@xps13> <20200928165528.54e5db6e@xps13> <20200928174505.75fda272@collabora.com> <20200928175005.48783b61@xps13> <20200928180343.4c5302a5@collabora.com> <20200928182159.5a6cf46a@xps13> Organization: Collabora X-Mailer: Claws Mail 3.17.6 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 28 Sep 2020 18:21:59 +0200 Miquel Raynal wrote: > Hi Boris, > > Boris Brezillon wrote on Mon, 28 Sep > 2020 18:03:43 +0200: > > > On Mon, 28 Sep 2020 17:50:05 +0200 > > Miquel Raynal wrote: > > > > > > > The way OOB > > > > > bytes are organized do not seem relevant to me, I think i prefer the > > > > > "_4_/_8_" naming,even if it's not very explicit. > > > > > > > > The ECC strength doesn't say anything about the scheme used for ECC > > > > bytes placement, and you might end up with 2 different schemes > > > > providing the same strength, or the same scheme used for 2 different > > > > strengths. > > > > > > So perhaps both should be present in the name? > > > > No, the point was to re-use the same functions for various strengths if > > they use the same ECC placement scheme. > > I get the point, but is the current implementation generic enough? I > see hardcoded numbers, I have no idea if these numbers are common to > all strength given a specific layout, or if they only match for a given > strength? > > +static int micron_4_ooblayout_ecc(struct mtd_info *mtd, int section, > + struct mtd_oob_region *region) > +{ > + struct spinand_device *spinand = mtd_to_spinand(mtd); > + > + if (section >= spinand->base.memorg.pagesize / > + mtd->ecc_step_size) > + return -ERANGE; > + > + region->offset = (section * 16) + 8; > + region->length = 8; > + > + return 0; > +} > > If possible, I would like to avoid several successive renaming. Right, I thought those functions were patched to be generic, but that doesn't seem to be the case, so I guess sticking to __ makes sense for now.