diff mbox series

[2/3] mtd: devices: m25p80: Drop extra length clamping in m25p80_write()

Message ID 20190401044938.31237-2-andrew.smirnov@gmail.com
State Not Applicable
Delegated to: Ambarus Tudor
Headers show
Series [1/3] mtd: devices: m25p80: Simplify m25p80_read() | expand

Commit Message

Andrey Smirnov April 1, 2019, 4:49 a.m. UTC
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 mbox series

Patch

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)