From patchwork Tue Dec 15 18:48:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 557053 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3EEFA140297 for ; Wed, 16 Dec 2015 05:50:41 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=XcR6Qxte; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1a8uem-0003Xe-VB; Tue, 15 Dec 2015 18:49:04 +0000 Received: from mail-pa0-x243.google.com ([2607:f8b0:400e:c03::243]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a8ueg-0003OJ-Ep for linux-mtd@lists.infradead.org; Tue, 15 Dec 2015 18:48:59 +0000 Received: by mail-pa0-x243.google.com with SMTP id fl14so1217225pac.1 for ; Tue, 15 Dec 2015 10:48:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8B4XL9wMqceJNXiP9n6iHhuN8OsamyIimgPeig7lWyw=; b=XcR6QxtezEAWLOPpGbcl2YXp4LsEF8mcO9NeumHRrvp4advlZ6sS1ZlM+fmOnqGaSZ AzDwHVNMXUBhYyzU7CgyxsgGMO+KwN2AlV+UFdQCM2FvExPlrFSkMXJ+vxJNjXVJcc+s d2xcrxZTsRxdK4w1QhcGW1Chu+RZvUU2HSmoQuS5UQFnL4mXYc7rXG4yKPy9TyyqI9D5 BdJQLeEdzup9veZTfTzuZVqAfo2Bz+LelIbIInk1yrUeFHzD8HDYqYx9AXT65Yttbvle QzVJ3QWqalBPT8OadblbxMSOMMHl75Qz2tX/pGc6ufhuOWayidnE2ulZpheA/tzFktZ3 CaFw== X-Received: by 10.66.65.109 with SMTP id w13mr56366290pas.142.1450205317733; Tue, 15 Dec 2015 10:48:37 -0800 (PST) Received: from ban.mtv.corp.google.com ([172.22.64.120]) by smtp.gmail.com with ESMTPSA id b14sm3819610pfd.11.2015.12.15.10.48.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 15 Dec 2015 10:48:37 -0800 (PST) From: Brian Norris To: Subject: [PATCH for-4.4 2/2] mtd: spi-nor: fix stm_is_locked_sr() parameters Date: Tue, 15 Dec 2015 10:48:21 -0800 Message-Id: <1450205301-32207-2-git-send-email-computersforpeace@gmail.com> X-Mailer: git-send-email 2.6.0.rc2.230.g3dd15c0 In-Reply-To: <1450205301-32207-1-git-send-email-computersforpeace@gmail.com> References: <1450205301-32207-1-git-send-email-computersforpeace@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151215_104858_663099_FCCF7984 X-CRM114-Status: UNSURE ( 9.13 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2607:f8b0:400e:c03:0:0:0:243 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (computersforpeace[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Vasut , Felix Fietkau , =?UTF-8?q?Eddie=20Huang=20=28=E9=BB=83=E6=99=BA=E5=82=91=29?= , =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= , =?UTF-8?q?Milton=20Chiang=20=28=E6=B1=9F=E6=98=8E=E6=99=8F=29?= , linux-kernel@vger.kernel.org, Daniel Kurtz , Bayi Cheng , Brian Norris MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org stm_is_locked_sr() takes the status register (SR) value as the last parameter, not the second. Reported-by: Bayi Cheng Signed-off-by: Brian Norris Cc: Bayi Cheng --- drivers/mtd/spi-nor/spi-nor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c index f5d59de1ee6e..32477c4eb421 100644 --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c @@ -516,8 +516,8 @@ static int stm_unlock(struct spi_nor *nor, loff_t ofs, uint64_t len) status_old = read_sr(nor); /* Cannot unlock; would unlock larger region than requested */ - if (stm_is_locked_sr(nor, status_old, ofs - mtd->erasesize, - mtd->erasesize)) + if (stm_is_locked_sr(nor, ofs - mtd->erasesize, mtd->erasesize, + status_old)) return -EINVAL; /*