731ef21bb8f001a97fa554d2ea830b6e07ace97e
[openwrt/staging/ansuel.git] /
1 From dc176595bf184e89bf28fdf91cbc1d050dfe63b3 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 @@ -1263,9 +1263,6 @@ static int spi_nor_write(struct mtd_info
25
26 page_offset = do_div(aux, nor->page_size);
27 }
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);