From patchwork Sun May 26 15:39:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tokunori Ikegami X-Patchwork-Id: 1105577 X-Patchwork-Delegate: vigneshr@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="hhf+jeiB"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="BfSJ0tXZ"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45BkqK1RNRz9s3l for ; Mon, 27 May 2019 01:41:33 +1000 (AEST) 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=bDrRfHKYzHQTNildEybmBW4DWyRbXazYqtcUytY4qd4=; b=hhf+jeiBFoudUw+p8B2dtmTxpF tNsBODjV58rm3KuzFdiWvl5bLLL5VSsV9f17syDt9OSJNbrv0IMkgQT7suuWzq20L+eWMRRPYOZ3N 6sA6NtbaXc8tU93j1CQAJhDUiCwX+TxlwqTtuVN/QA0HjFMrj99v9kx++ysxvuOCyCmQZtb3DSs3c l2AbAzPvu1TssOuaxPgxgUe0x4QGUM5pipCpW9ZsgveumQvKXCADORZQfaxF7LI8glflsVe4q8WKm Hs4oRktHdvo0BcOcxmwXhkf3ig5NC/XAtWKHUMLEgL+VExn6Qsofox1CqoKs0cOHpJq2/2nnTk+l+ f+3m87kQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hUvH4-0002oP-KP; Sun, 26 May 2019 15:41:26 +0000 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hUvFP-00080W-Lz for linux-mtd@lists.infradead.org; Sun, 26 May 2019 15:39:53 +0000 Received: by mail-pg1-x541.google.com with SMTP id a3so7670153pgb.3 for ; Sun, 26 May 2019 08:39:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=I+Nla+eYiRgNyjc6CFBwjIMp6EjQQX4EWjH7ft2Hovc=; b=BfSJ0tXZcaSX94MMZmOPoYNgexH+djrsPZWFh5ukesK8D8+u6rOx2xc6SdKuwNka0m kTq7U02jrDBZGm23IFteiTdGg4Gi7P8Wm9fjG/Sp56O85APCqw5ciAUMdBb106tp9XE3 CveHveAolHejTBuQ+hLhHgZgACJjbKEc+USLm/qwBzam6P/syxy2HP7KNppJeel54I7S qgxmJBikLx7372iAH0/OlXlcYqyXjOwRyIQ7unMGU4wN57GeUil64USmO2u7AjoAGYQS iKJOcqXoDQqJ/1G/P2pf8aSIORmDjfaycbLBC+UCOxvsDEh0E43tTfujF60Z3MZSKN3T Jltw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=I+Nla+eYiRgNyjc6CFBwjIMp6EjQQX4EWjH7ft2Hovc=; b=jyKQjNXQOi1wdpRVoju2NZ6zOe8gz+cYIDolvOqTxZ1z57JJ9pS98jAMkbClAQJGIi rtXSeMlkD4OjexS5EWCYfILRzdwFAaqugA5JmSd8o3Sx959MMokDCKRjc5R2FOtNRGUp 0jhGS/cvP7grb0lrNxfeHTJhW6+YcVCuK3nxxMdmhRugAzs5ZNyQP9aTxkRVpiEqUlN8 SO12NxrcSVcBuSdg8ZbSWp0vWTTK+E1R4DgDRpCLC8TVi6AHrBTEcxhkLjoEhVpPIs82 k7htmW1ycE+Hf5dIkYz1jYauGjplVN3Q2iyVYM9Tyii6m4vyLH+rwDhjkXfaf3b0BIr/ bwBw== X-Gm-Message-State: APjAAAWPJPca8CxSGsiSD0QH4okCF2VEOu29KUHp0jEU8sfDnhonZHJG 6Y6CU+7Z5vH/+N2YfvGjvGY= X-Google-Smtp-Source: APXvYqz0m5JPYn2XV0YMXz1lxzU0skjM+F6VTaxdww1XwugTT14tAYdDv6JKkSp9DKLClHAlXWgduw== X-Received: by 2002:a17:90a:80c7:: with SMTP id k7mr24686087pjw.90.1558885182995; Sun, 26 May 2019 08:39:42 -0700 (PDT) Received: from localhost.localdomain (M106072039032.v4.enabler.ne.jp. [106.72.39.32]) by smtp.gmail.com with ESMTPSA id o2sm863129pgm.51.2019.05.26.08.39.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 May 2019 08:39:42 -0700 (PDT) From: Tokunori Ikegami To: Vignesh Raghavendra Subject: [PATCH v6 11/11] mtd: cfi_cmdset_0002: Disable write buffer functions if FORCE_WORD_WRITE is 1 Date: Mon, 27 May 2019 00:39:04 +0900 Message-Id: <20190526153904.28871-12-ikegami.t@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190526153904.28871-1-ikegami.t@gmail.com> References: <20190526153904.28871-1-ikegami.t@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190526_083944_222726_F0F5DA99 X-CRM114-Status: GOOD ( 13.24 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:541 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (ikegami.t[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 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: Tokunori Ikegami , Chris Packham , linux-mtd@lists.infradead.org, Fabio Bettoni , Joakim Tjernlund MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Some write buffer functions are not used when FORCE_WORD_WRITE is set to 1. So the compile warning messages are output if FORCE_WORD_WRITE is 1. To resolve this disable the write buffer functions if FORCE_WORD_WRITE is 1. Signed-off-by: Tokunori Ikegami Cc: Fabio Bettoni Co: Hauke Mehrtens Co: Koen Vandeputte Cc: Chris Packham Cc: Joakim Tjernlund Cc: linux-mtd@lists.infradead.org --- Changes since v5: - Add the patch. drivers/mtd/chips/cfi_cmdset_0002.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c index 477bc3d65e68..2144221029e9 100755 --- a/drivers/mtd/chips/cfi_cmdset_0002.c +++ b/drivers/mtd/chips/cfi_cmdset_0002.c @@ -51,7 +51,9 @@ static int cfi_amdstd_read (struct mtd_info *, loff_t, size_t, size_t *, u_char *); static int cfi_amdstd_write_words(struct mtd_info *, loff_t, size_t, size_t *, const u_char *); +#if !FORCE_WORD_WRITE static int cfi_amdstd_write_buffers(struct mtd_info *, loff_t, size_t, size_t *, const u_char *); +#endif static int cfi_amdstd_erase_chip(struct mtd_info *, struct erase_info *); static int cfi_amdstd_erase_varsize(struct mtd_info *, struct erase_info *); static void cfi_amdstd_sync (struct mtd_info *); @@ -202,6 +204,7 @@ static void fixup_amd_bootblock(struct mtd_info *mtd) } #endif +#if !FORCE_WORD_WRITE static void fixup_use_write_buffers(struct mtd_info *mtd) { struct map_info *map = mtd->priv; @@ -211,6 +214,7 @@ static void fixup_use_write_buffers(struct mtd_info *mtd) mtd->_write = cfi_amdstd_write_buffers; } } +#endif /* !FORCE_WORD_WRITE */ /* Atmel chips don't use the same PRI format as AMD chips */ static void fixup_convert_atmel_pri(struct mtd_info *mtd) @@ -1836,6 +1840,7 @@ static int cfi_amdstd_write_words(struct mtd_info *mtd, loff_t to, size_t len, return 0; } +#if !FORCE_WORD_WRITE static int __xipram do_write_buffer_wait(struct map_info *map, struct flchip *chip, unsigned long adr, map_word datum) @@ -2064,6 +2069,7 @@ static int cfi_amdstd_write_buffers(struct mtd_info *mtd, loff_t to, size_t len, return 0; } +#endif /* !FORCE_WORD_WRITE */ /* * Wait for the flash chip to become ready to write data