7c70d20a43a3c6a93bf5090c8fdc054311ff564a
[openwrt/staging/pepe2k.git] /
1 From bc0e151514d09cadb56e473a10c783e64e48ce0b Mon Sep 17 00:00:00 2001
2 From: Cyrille Pitchen <cyrille.pitchen@atmel.com>
3 Date: Tue, 6 Dec 2016 18:14:24 +0100
4 Subject: [PATCH] mtd: spi-nor: remove WARN_ONCE() message in spi_nor_write()
5
6 This patch removes the WARN_ONCE() test in spi_nor_write().
7 This macro triggers the display of a warning message almost every time we
8 use a UBI file-system because a write operation is performed at offset 64,
9 which is in the middle of the SPI NOR memory page. This is a valid
10 operation for ubifs.
11
12 Hence this warning is pretty annoying and useless so we just remove it.
13
14 Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
15 Suggested-by: Richard Weinberger <richard@nod.at>
16 Suggested-by: Andras Szemzo <szemzo.andras@gmail.com>
17 Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
18 ---
19 drivers/mtd/spi-nor/spi-nor.c | 3 ---
20 1 file changed, 3 deletions(-)
21
22 --- a/drivers/mtd/spi-nor/spi-nor.c
23 +++ b/drivers/mtd/spi-nor/spi-nor.c
24 @@ -1014,9 +1014,6 @@ static int spi_nor_write(struct mtd_info
25 ssize_t written;
26
27 page_offset = (to + i) & (nor->page_size - 1);
28 - WARN_ONCE(page_offset,
29 - "Writing at offset %zu into a NOR page. Writing partial pages may decrease reliability and increase wear of NOR flash.",
30 - page_offset);
31 /* the size of data remaining on the first page */
32 page_remain = min_t(size_t,
33 nor->page_size - page_offset, len - i);