{"id":813160,"url":"http://patchwork.ozlabs.org/api/1.2/patches/813160/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-mtd/patch/1505280046-16608-2-git-send-email-yamada.masahiro@socionext.com/","project":{"id":3,"url":"http://patchwork.ozlabs.org/api/1.2/projects/3/?format=json","name":"Linux MTD development","link_name":"linux-mtd","list_id":"linux-mtd.lists.infradead.org","list_email":"linux-mtd@lists.infradead.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<1505280046-16608-2-git-send-email-yamada.masahiro@socionext.com>","list_archive_url":null,"date":"2017-09-13T05:20:38","name":"[1/9] mtd: nand: denali: squash setup_ecc_for_xfer() helper into caller","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"f7070ea2156d0ecb40f8e27a03b02f327b52e31c","submitter":{"id":65882,"url":"http://patchwork.ozlabs.org/api/1.2/people/65882/?format=json","name":"Masahiro Yamada","email":"yamada.masahiro@socionext.com"},"delegate":{"id":58324,"url":"http://patchwork.ozlabs.org/api/1.2/users/58324/?format=json","username":"bbrezillon","first_name":"Boris","last_name":"Brezillon","email":"boris.brezillon@free-electrons.com"},"mbox":"http://patchwork.ozlabs.org/project/linux-mtd/patch/1505280046-16608-2-git-send-email-yamada.masahiro@socionext.com/mbox/","series":[{"id":2809,"url":"http://patchwork.ozlabs.org/api/1.2/series/2809/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-mtd/list/?series=2809","date":"2017-09-13T05:20:39","name":"mtd: nand: denali: more clean-ups","version":1,"mbox":"http://patchwork.ozlabs.org/series/2809/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/813160/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/813160/checks/","tags":{},"related":[],"headers":{"Return-Path":"<linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org; spf=none (mailfrom)\n\tsmtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133;\n\thelo=bombadil.infradead.org;\n\tenvelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org header.b=\"IRuSRKdD\"; \n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=nifty.com header.i=@nifty.com\n\theader.b=\"BtBvtVP2\"; dkim-atps=neutral"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xsVTm6Dzwz9sPm\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 13 Sep 2017 15:24:44 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1ds0A7-0000EI-BF; Wed, 13 Sep 2017 05:24:35 +0000","from conuserg-12.nifty.com ([210.131.2.79])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1ds07J-0006Xu-NI\n\tfor linux-mtd@lists.infradead.org; Wed, 13 Sep 2017 05:21:51 +0000","from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp\n\t[153.142.97.92]) (authenticated)\n\tby conuserg-12.nifty.com with ESMTP id v8D5Kpx0010397;\n\tWed, 13 Sep 2017 14:20:52 +0900"],"DKIM-Signature":["v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe:\n\tList-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References:\n\tIn-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID:\n\tContent-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc\n\t:Resent-Message-ID:List-Owner;\n\tbh=6c0wfUC8zovFH0HGypL9rGRld4eGbgyZOhYLL3IPgQU=;\n\tb=IRuSRKdDNUGo4XmtXwEMGaqm46\n\tkPbNkmWB4D0pzhE0bGeLaN4gLTDDlOIQRx0NcYGUHWUcZz05DHbBW2WUymz1BF6UQ00BkaUmQVnij\n\tIyICGHTwTsukPR6FTANtt/FTxNPnE2ROyv6GUKacBs8eVkj4KhmGS+vpTDKArfxvua14WOMs0vjz8\n\t6C5ytr0QTdKxIlEYE2AUYGLaOUVgxM3FBYeLWI6UpUuO11OoeDihHTfOU76wQMMEQC/aXcCvZlmAN\n\tcsYz/FVMxZlwuTddRbKVr3FKRjL/1xFpOa76P60LSPdgaBwMsDrd/dzcdIXLcDiFCA1GHm93lSs5I\n\tOTAFDVHQ==;","v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com;\n\ts=dec2015msa; t=1505280052;\n\tbh=jQQQxSecA6Q5ovCRIaC2UvnM2j63/is96LE1R2hVxsM=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=BtBvtVP2Lti29Jqtozi0yCLSmNc0P/5VSUeNJrjsQwLzB0xJtQhLYxz7anhNUceny\n\tH8/6i4hynsRM8MLShc7P1vNefBmCb8+0slPPINBXjfYOxHDuth+2ZbeV0wnAPp45gX\n\tfAiegDD1l4vmq1teMpETUCV0fAj2EZSpNRqzrmInsvLh8EmuOx77GTR/KAeXB3/7yk\n\tVTdaFyC9y55ExEmM8m9a+6mnGfhj1e1om18884i4ecjuvvo1J+ua/cw8rGj2/s1kDx\n\tta89UZDLsz+orfMUXFxiD2LxJ5aJDEui9RXBpKTuQWObFd5fCFrLqF4xmPjS086XI1\n\tRRvEupA4pQlkg=="],"DKIM-Filter":"OpenDKIM Filter v2.10.3 conuserg-12.nifty.com v8D5Kpx0010397","X-Nifty-SrcIP":"[153.142.97.92]","From":"Masahiro Yamada <yamada.masahiro@socionext.com>","To":"linux-mtd@lists.infradead.org","Subject":"[PATCH 1/9] mtd: nand: denali: squash setup_ecc_for_xfer() helper\n\tinto caller","Date":"Wed, 13 Sep 2017 14:20:38 +0900","Message-Id":"<1505280046-16608-2-git-send-email-yamada.masahiro@socionext.com>","X-Mailer":"git-send-email 2.7.4","In-Reply-To":"<1505280046-16608-1-git-send-email-yamada.masahiro@socionext.com>","References":"<1505280046-16608-1-git-send-email-yamada.masahiro@socionext.com>","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170912_222142_305994_0EC25DCA ","X-CRM114-Status":"GOOD (  11.05  )","X-Spam-Score":"-1.2 (-)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-1.2 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail)\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]\n\t-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature\n\t0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n\tnot necessarily valid","X-BeenThere":"linux-mtd@lists.infradead.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"Linux MTD discussion mailing list <linux-mtd.lists.infradead.org>","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-mtd/>","List-Post":"<mailto:linux-mtd@lists.infradead.org>","List-Help":"<mailto:linux-mtd-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=subscribe>","Cc":"Boris Brezillon <boris.brezillon@free-electrons.com>,\n\tMarek Vasut <marek.vasut@gmail.com>,\n\tRichard Weinberger <richard@nod.at>, linux-kernel@vger.kernel.org,\n\tMasahiro Yamada <yamada.masahiro@socionext.com>, \n\tCyrille Pitchen <cyrille.pitchen@wedev4u.fr>,\n\tBrian Norris <computersforpeace@gmail.com>,\n\tDavid Woodhouse <dwmw2@infradead.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"linux-mtd\" <linux-mtd-bounces@lists.infradead.org>","Errors-To":"linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"},"content":"The setup_ecc_for_xfer() is only called from denali_data_xfer().\nThis helper is small enough, so squash it into the caller.\nThis looks cleaner to me.\n\nSigned-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>\n---\n\n drivers/mtd/nand/denali.c | 22 +++-------------------\n 1 file changed, 3 insertions(+), 19 deletions(-)","diff":"diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c\nindex aefdc83..d847ae4 100644\n--- a/drivers/mtd/nand/denali.c\n+++ b/drivers/mtd/nand/denali.c\n@@ -208,24 +208,6 @@ static uint32_t denali_check_irq(struct denali_nand_info *denali)\n \treturn irq_status;\n }\n \n-/*\n- * This helper function setups the registers for ECC and whether or not\n- * the spare area will be transferred.\n- */\n-static void setup_ecc_for_xfer(struct denali_nand_info *denali, bool ecc_en,\n-\t\t\t\tbool transfer_spare)\n-{\n-\tint ecc_en_flag, transfer_spare_flag;\n-\n-\t/* set ECC, transfer spare bits if needed */\n-\tecc_en_flag = ecc_en ? ECC_ENABLE__FLAG : 0;\n-\ttransfer_spare_flag = transfer_spare ? TRANSFER_SPARE_REG__FLAG : 0;\n-\n-\t/* Enable spare area/ECC per user's request. */\n-\tiowrite32(ecc_en_flag, denali->reg + ECC_ENABLE);\n-\tiowrite32(transfer_spare_flag, denali->reg + TRANSFER_SPARE_REG);\n-}\n-\n static void denali_read_buf(struct mtd_info *mtd, uint8_t *buf, int len)\n {\n \tstruct denali_nand_info *denali = mtd_to_denali(mtd);\n@@ -659,7 +641,9 @@ static int denali_dma_xfer(struct denali_nand_info *denali, void *buf,\n static int denali_data_xfer(struct denali_nand_info *denali, void *buf,\n \t\t\t    size_t size, int page, int raw, int write)\n {\n-\tsetup_ecc_for_xfer(denali, !raw, raw);\n+\tiowrite32(raw ? 0 : ECC_ENABLE__FLAG, denali->reg + ECC_ENABLE);\n+\tiowrite32(raw ? TRANSFER_SPARE_REG__FLAG : 0,\n+\t\t  denali->reg + TRANSFER_SPARE_REG);\n \n \tif (denali->dma_avail)\n \t\treturn denali_dma_xfer(denali, buf, size, page, raw, write);\n","prefixes":["1/9"]}