From patchwork Tue Dec 5 08:47:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 120625 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5480404qgn; Tue, 5 Dec 2017 00:48:35 -0800 (PST) X-Google-Smtp-Source: AGs4zMY4fYdtlECiw69zeaZsaC7L1tD2Sd6AlOhQlQp5wQESRs38LrLyv4zdaHlSYbCxmD4IdOHR X-Received: by 10.101.73.74 with SMTP id q10mr16674876pgs.127.1512463715908; Tue, 05 Dec 2017 00:48:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512463715; cv=none; d=google.com; s=arc-20160816; b=phm2fFGpFsebQfkL40tJ2qL26pKkAcDjUMSa+UAeqSH7DtU9uDJ4S6omg7TvDsSCh3 9QGXT0xsFUnER3lMguorrKl0PJXdxQNUCmHZC1PxE4ltaJQekWBO3NBzCSPJjHWNOcKM JWUY+8x9oVFEkhPMdhNo50sILG3vS8Lyi4ZDfdpCJYYFs5dJ9QmvjyRqTU2ElmY9gUuV aO3Q49DfvqWrE6EVtbaKsyWOmHIhUAXrXiRc5BbqRWwubOFORAcwjIAv486i9t4+w9sP xwxZzHMN8Df02C9Igs6S1IYspjQnSZtCpaPFKmSlTFkLWn/lEtR4c8+KZTQo5IoaM7Rv qJHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:references:in-reply-to:message-id:date:subject :to:from:dkim-signature:dkim-filter:dkim-signature :arc-authentication-results; bh=c1MH56JUwcksY+wau7TNDkqNyhz/ZhdXnQAA3SObgPk=; b=S1FtsODS5nWMQ3e5mV0POJEXQ63RQ/orLnPUASc5dE1toffQjr98dpRWWlNcU8Qb3A F9j5FMtF8iSo2zZvqZuZkvvfLRYCWaxg6W8dto8Wu6JFh6cGREF6DNh7ON5lT9GAGMMT OjE6ajjR3lsRzhiZs9E/7Mun/EkQt1d46BIu0gFdf69R7oc3HSA9ESq13gt0Fp2mi9DY B3FDJ0FrYZP0zTATLEGzqi+Tixjo9a0HE+7gzSiTHsw8C530B+TKbjvYP27WkUHc5RTC tJv4YoSLke9i9xw7T8GBLIcNtO1yqWpSJ8I2sguK6f19WKusbtoKbuLQPsyRzRjQdtvv ecHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=EhmJWNfA; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=RUQzlTSw; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) smtp.mailfrom=linux-mtd-bounces+patch=linaro.org@lists.infradead.org Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [65.50.211.133]) by mx.google.com with ESMTPS id f128si8227545pgc.152.2017.12.05.00.48.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Dec 2017 00:48:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) client-ip=65.50.211.133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=EhmJWNfA; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=RUQzlTSw; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) smtp.mailfrom=linux-mtd-bounces+patch=linaro.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=c1MH56JUwcksY+wau7TNDkqNyhz/ZhdXnQAA3SObgPk=; b=EhmJWNfAdUN4zY3Dt6PCtsCB7O gC4L8iJJtN1t/KecyP1CxZZ9uXBt4OA82PQ+0zx4P+qtErWN2yUY2LPmu9l5TqwYP6BEzLp/GvYQR BRi0B8GT/lpQ29TFAZb4F2ZxMcghvfUdMHCaxKKVlpWHT7y+UD16fseoyz6+ywNyxblY1GX+eq26A AQJVh75zJwSWFCK6cK/+C4zaWCjD7J0sy3g1TruqnutytPS7uAg879IsSRx/DoXVF3YqruQi43U17 pQ6UIof0TTqjS6IhffI7m1fRvf1kLk6P/i9J+vQsDk0eKrLHyO3kW/txoURrruclzwPo6EjMCmFzq nmd8YU0w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eM8tw-0004HQ-M5; Tue, 05 Dec 2017 08:48:28 +0000 Received: from conuserg-08.nifty.com ([210.131.2.75]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eM8th-000443-BK for linux-mtd@lists.infradead.org; Tue, 05 Dec 2017 08:48:15 +0000 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id vB58lQkI015545; Tue, 5 Dec 2017 17:47:27 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com vB58lQkI015545 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1512463648; bh=QTfOHrpmC9LDc8+ZHCSVFaMafJzPaR86IWGWotJuhQE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RUQzlTSwuwScaYaxJ2uxiDgdbFAZG0MI07+syeLfZWKjJJ+WFk9aCFqf9zjvzJK8m 4f9yMX9CeJtzdn0ey8zsWIhcux1UP61/XAyir6xMx2Q+C68pxErDuYU0SKu+yyiDd9 XW/BH8aggdQJ+wjiipVbjWVSwrfF+9E2RMkynOq/TrjzdxoQzxLL5ihyb/396MqYfP pD1ghg26WRFsHkhVC0x1qTTuWU1WSLIZ6Go4QPmNi769MFzypJGJr8uDCDEHdU0Ny4 eUUV061UMA/O0zQqkLa4XLdF6Ba5ee4YQhM1lHnSHlzwH3+GpNycQabIFA2KQ6GDhH iGY5O8UOwIyXQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-mtd@lists.infradead.org, Boris Brezillon Subject: [PATCH v2 2/3] mtd: nand: remove unused NAND_OWN_BUFFERS flag Date: Tue, 5 Dec 2017 17:47:15 +0900 Message-Id: <1512463636-28934-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512463636-28934-1-git-send-email-yamada.masahiro@socionext.com> References: <1512463636-28934-1-git-send-email-yamada.masahiro@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171205_004813_812268_1F42456E X-CRM114-Status: GOOD ( 12.23 ) X-Spam-Score: -1.2 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Vasut , Richard Weinberger , linux-kernel@vger.kernel.org, Masahiro Yamada , Cyrille Pitchen , Brian Norris , David Woodhouse MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org The last/only user of NAND_OWN_BUFFERS (cafe_nand.c) has been reworked. This flag is no longer needed. Suggested-by: Boris Brezillon Signed-off-by: Masahiro Yamada --- Changes in v2: - Newly added drivers/mtd/nand/nand_base.c | 45 ++++++++++++++++++++------------------------ include/linux/mtd/rawnand.h | 5 ----- 2 files changed, 20 insertions(+), 30 deletions(-) -- 2.7.4 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 6135d00..0cc61b1 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -4646,35 +4646,30 @@ int nand_scan_tail(struct mtd_info *mtd) return -EINVAL; } - if (!(chip->options & NAND_OWN_BUFFERS)) { - nbuf = kzalloc(sizeof(*nbuf), GFP_KERNEL); - if (!nbuf) - return -ENOMEM; - - nbuf->ecccalc = kmalloc(mtd->oobsize, GFP_KERNEL); - if (!nbuf->ecccalc) { - ret = -ENOMEM; - goto err_free_nbuf; - } + nbuf = kzalloc(sizeof(*nbuf), GFP_KERNEL); + if (!nbuf) + return -ENOMEM; - nbuf->ecccode = kmalloc(mtd->oobsize, GFP_KERNEL); - if (!nbuf->ecccode) { - ret = -ENOMEM; - goto err_free_nbuf; - } + nbuf->ecccalc = kmalloc(mtd->oobsize, GFP_KERNEL); + if (!nbuf->ecccalc) { + ret = -ENOMEM; + goto err_free_nbuf; + } - nbuf->databuf = kmalloc(mtd->writesize + mtd->oobsize, - GFP_KERNEL); - if (!nbuf->databuf) { - ret = -ENOMEM; - goto err_free_nbuf; - } + nbuf->ecccode = kmalloc(mtd->oobsize, GFP_KERNEL); + if (!nbuf->ecccode) { + ret = -ENOMEM; + goto err_free_nbuf; + } - chip->buffers = nbuf; - } else if (!chip->buffers) { - return -ENOMEM; + nbuf->databuf = kmalloc(mtd->writesize + mtd->oobsize, GFP_KERNEL); + if (!nbuf->databuf) { + ret = -ENOMEM; + goto err_free_nbuf; } + chip->buffers = nbuf; + /* * FIXME: some NAND manufacturer drivers expect the first die to be * selected when manufacturer->init() is called. They should be fixed @@ -5032,7 +5027,7 @@ void nand_cleanup(struct nand_chip *chip) /* Free bad block table memory */ kfree(chip->bbt); - if (!(chip->options & NAND_OWN_BUFFERS) && chip->buffers) { + if (chip->buffers) { kfree(chip->buffers->databuf); kfree(chip->buffers->ecccode); kfree(chip->buffers->ecccalc); diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h index 749bb08..5b24a8e 100644 --- a/include/linux/mtd/rawnand.h +++ b/include/linux/mtd/rawnand.h @@ -191,11 +191,6 @@ enum nand_ecc_algo { /* Non chip related options */ /* This option skips the bbt scan during initialization. */ #define NAND_SKIP_BBTSCAN 0x00010000 -/* - * This option is defined if the board driver allocates its own buffers - * (e.g. because it needs them DMA-coherent). - */ -#define NAND_OWN_BUFFERS 0x00020000 /* Chip may not exist, so silence any errors in scan */ #define NAND_SCAN_SILENT_NODEV 0x00040000 /*