mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 4/7] mtd: Fix mtd_op_read for devices >4GiB
Date: Tue,  9 Feb 2016 10:55:45 +0100	[thread overview]
Message-ID: <1455011748-5538-5-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1455011748-5538-1-git-send-email-s.hauer@pengutronix.de>

The mtd read file operation has a unnecessary conversion to unsigned
long in the read offset. Remove it to make it work with chips >4GiB

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/mtd/core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/core.c b/drivers/mtd/core.c
index 586b4a0..3251bbc 100644
--- a/drivers/mtd/core.c
+++ b/drivers/mtd/core.c
@@ -67,14 +67,13 @@ int mtd_all_ff(const void *buf, unsigned int len)
 }
 
 static ssize_t mtd_op_read(struct cdev *cdev, void* buf, size_t count,
-			  loff_t _offset, ulong flags)
+			  loff_t offset, ulong flags)
 {
 	struct mtd_info *mtd = cdev->priv;
 	size_t retlen;
 	int ret;
-	unsigned long offset = _offset;
 
-	dev_dbg(cdev->dev, "read ofs: 0x%08lx count: 0x%08zx\n",
+	dev_dbg(cdev->dev, "read ofs: 0x%08llx count: 0x%08zx\n",
 			offset, count);
 
 	ret = mtd_read(mtd, offset, count, &retlen, buf);
-- 
2.7.0.rc3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2016-02-09  9:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-09  9:55 [PATCH] mtd: >4GiB fixes Sascha Hauer
2016-02-09  9:55 ` [PATCH 1/7] mtd: nand-bb: Fix 8k page size nands Sascha Hauer
2016-02-09  9:55 ` [PATCH 2/7] mtd: Fix mtdraw for Nand > 4GiB Sascha Hauer
2016-02-09  9:55 ` [PATCH 3/7] mtd: Make erase_info structs 64bit where necessary Sascha Hauer
2016-02-09  9:55 ` Sascha Hauer [this message]
2016-02-09  9:55 ` [PATCH 5/7] mtd: Fix mtd_op_erase for devices >4GiB Sascha Hauer
2016-02-09  9:55 ` [PATCH 6/7] mtd: Fix erasing of " Sascha Hauer
2016-02-09  9:55 ` [PATCH 7/7] mtd: mtdoob device: change name to have the chip name first Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1455011748-5538-5-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox