Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754252AbbLOStK (ORCPT ); Tue, 15 Dec 2015 13:49:10 -0500 Received: from mail-pa0-f66.google.com ([209.85.220.66]:34895 "EHLO mail-pa0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933425AbbLOSsi (ORCPT ); Tue, 15 Dec 2015 13:48:38 -0500 From: Brian Norris To: Cc: , Brian Norris , Daniel Kurtz , Marek Vasut , Bayi Cheng , =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= , Felix Fietkau , =?UTF-8?q?Eddie=20Huang=20=28=E9=BB=83=E6=99=BA=E5=82=91=29?= , =?UTF-8?q?Milton=20Chiang=20=28=E6=B1=9F=E6=98=8E=E6=99=8F=29?= 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> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1186 Lines: 33 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; /* -- 2.6.0.rc2.230.g3dd15c0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/