From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: linux-mtd@lists.infradead.org
Cc: Andrey Smirnov <andrew.smirnov@gmail.com>,
Brian Norris <computersforpeace@gmail.com>,
Boris Brezillon <boris.brezillon@bootlin.com>,
Marek Vasut <marek.vasut@gmail.com>,
Chris Healy <cphealy@gmail.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH 2/3] mtd: devices: m25p80: Drop extra length clamping in m25p80_write()
Date: Sun, 31 Mar 2019 21:49:37 -0700 [thread overview]
Message-ID: <20190401044938.31237-2-andrew.smirnov@gmail.com> (raw)
In-Reply-To: <20190401044938.31237-1-andrew.smirnov@gmail.com>
All of the needed length clamping should already be taken care of by
spi_mem_adjust_op_size(). No check like this is done in read path, so
this extra check in write doesn't appear to be necessary. Drop it.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: Brian Norris <computersforpeace@gmail.com>
Cc: Boris Brezillon <boris.brezillon@bootlin.com>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Chris Healy <cphealy@gmail.com>
Cc: linux-mtd@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---
drivers/mtd/devices/m25p80.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index 114f8ccea85b..a54cad9bb6e3 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -103,7 +103,6 @@ static ssize_t m25p80_write(struct spi_nor *nor, loff_t to, size_t len,
ret = spi_mem_adjust_op_size(flash->spimem, &op);
if (ret)
return ret;
- op.data.nbytes = len < op.data.nbytes ? len : op.data.nbytes;
ret = spi_mem_exec_op(flash->spimem, &op);
if (ret)
--
2.20.1
next prev parent reply other threads:[~2019-04-01 4:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-01 4:49 [PATCH 1/3] mtd: devices: m25p80: Simplify m25p80_read() Andrey Smirnov
2019-04-01 4:49 ` Andrey Smirnov [this message]
2019-04-01 4:49 ` [PATCH 3/3] mtd: devices: m25p80: Share code between m25p80_read() and m25p80_write() Andrey Smirnov
2019-04-02 6:36 ` [PATCH 1/3] mtd: devices: m25p80: Simplify m25p80_read() Vignesh Raghavendra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190401044938.31237-2-andrew.smirnov@gmail.com \
--to=andrew.smirnov@gmail.com \
--cc=boris.brezillon@bootlin.com \
--cc=computersforpeace@gmail.com \
--cc=cphealy@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=marek.vasut@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®