mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Jan Luebbe <jlu@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH v2] mtd: fix 'write: Invalid argument' while writing to nand-bb devices
Date: Mon, 16 Jul 2012 09:10:35 +0200	[thread overview]
Message-ID: <20120716071035.GT30009@pengutronix.de> (raw)
In-Reply-To: <1342086362-2129-1-git-send-email-jlu@pengutronix.de>

On Thu, Jul 12, 2012 at 11:46:02AM +0200, Jan Luebbe wrote:
> The 'off_t cur_ofs' variable was missed during the 64 bit conversion.
> For the MEMGETBADBLOCK ioctl, a pointer to a loff_t is needed.
> 
> Also adjust the debug format strings.

Applied, thanks

Sascha

> 
> Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
> ---
>  drivers/mtd/nand/nand-bb.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mtd/nand/nand-bb.c b/drivers/mtd/nand/nand-bb.c
> index 5b06a9e..519337e 100644
> --- a/drivers/mtd/nand/nand-bb.c
> +++ b/drivers/mtd/nand/nand-bb.c
> @@ -60,7 +60,7 @@ static ssize_t nand_bb_read(struct cdev *cdev, void *buf, size_t count,
>  	struct cdev *parent = bb->cdev_parent;
>  	int ret, bytes = 0, now;
>  
> -	debug("%s %d %d\n", __func__, offset, count);
> +	debug("%s 0x%08llx %d\n", __func__, offset, count);
>  
>  	while(count) {
>  		ret = cdev_ioctl(parent, MEMGETBADBLOCK, &bb->offset);
> @@ -96,7 +96,7 @@ static int nand_bb_write_buf(struct nand_bb *bb, size_t count)
>  	int ret, now;
>  	struct cdev *parent = bb->cdev_parent;
>  	void *buf = bb->writebuf;
> -	off_t cur_ofs = bb->offset & ~(BB_WRITEBUF_SIZE - 1);
> +	loff_t cur_ofs = bb->offset & ~(BB_WRITEBUF_SIZE - 1);
>  
>  	while (count) {
>  		ret = cdev_ioctl(parent, MEMGETBADBLOCK, &cur_ofs);
> @@ -104,7 +104,7 @@ static int nand_bb_write_buf(struct nand_bb *bb, size_t count)
>  			return ret;
>  
>  		if (ret) {
> -			debug("skipping bad block at 0x%08x\n", cur_ofs);
> +			debug("skipping bad block at 0x%08llx\n", cur_ofs);
>  			bb->offset += bb->info.erasesize;
>  			cur_ofs += bb->info.erasesize;
>  			continue;
> -- 
> 1.7.10.4
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

      reply	other threads:[~2012-07-16  7:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-12  9:46 Jan Luebbe
2012-07-16  7:10 ` Sascha Hauer [this message]

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=20120716071035.GT30009@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=jlu@pengutronix.de \
    /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