062-v4.11-0003-mtd-spi-nor-remove-WARN_ONCE-message-in-spi_nor_writ.patch 1.4 KB

123456789101112131415161718192021222324252627282930313233
  1. From dc176595bf184e89bf28fdf91cbc1d050dfe63b3 Mon Sep 17 00:00:00 2001
  2. From: Cyrille Pitchen <[email protected]>
  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. This patch removes the WARN_ONCE() test in spi_nor_write().
  6. This macro triggers the display of a warning message almost every time we
  7. use a UBI file-system because a write operation is performed at offset 64,
  8. which is in the middle of the SPI NOR memory page. This is a valid
  9. operation for ubifs.
  10. Hence this warning is pretty annoying and useless so we just remove it.
  11. Signed-off-by: Cyrille Pitchen <[email protected]>
  12. Suggested-by: Richard Weinberger <[email protected]>
  13. Suggested-by: Andras Szemzo <[email protected]>
  14. Acked-by: Boris Brezillon <[email protected]>
  15. ---
  16. drivers/mtd/spi-nor/spi-nor.c | 3 ---
  17. 1 file changed, 3 deletions(-)
  18. --- a/drivers/mtd/spi-nor/spi-nor.c
  19. +++ b/drivers/mtd/spi-nor/spi-nor.c
  20. @@ -1263,9 +1263,6 @@ static int spi_nor_write(struct mtd_info
  21. page_offset = do_div(aux, nor->page_size);
  22. }
  23. - WARN_ONCE(page_offset,
  24. - "Writing at offset %zu into a NOR page. Writing partial pages may decrease reliability and increase wear of NOR flash.",
  25. - page_offset);
  26. /* the size of data remaining on the first page */
  27. page_remain = min_t(size_t,
  28. nor->page_size - page_offset, len - i);