mtd: rawnand: Avoid indirect access to ->data_buf()
authorMiquel Raynal <miquel.raynal@bootlin.com>
Thu, 7 May 2020 10:52:34 +0000 (12:52 +0200)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 11 May 2020 07:51:42 +0000 (09:51 +0200)
The logic in nand_do_read_ops() is to use a bufpoi variable, either
set to the original buffer, or set to a bounce buffer which in the end
happens to be chip->data_buf depending on the value of the
use_bounce_buf boolean. This is not a reason to call chip->data_buf
directly when we know that we are using the bounce buffer. Let's use
bufpoi instead to be consistent.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Link: https://lore.kernel.org/linux-mtd/20200507105241.14299-7-miquel.raynal@bootlin.com
drivers/mtd/nand/raw/nand_base.c

index e2d9665..c440f11 100644 (file)
@@ -3293,7 +3293,7 @@ read_retry:
                                        /* Invalidate page cache */
                                        chip->pagecache.page = -1;
                                }
-                               memcpy(buf, chip->data_buf + col, bytes);
+                               memcpy(buf, bufpoi + col, bytes);
                        }
 
                        if (unlikely(oob)) {