mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Alexander Aring <alex.aring@googlemail.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] fs: fs.c fix cast
Date: Tue, 11 Sep 2012 09:20:09 +0200	[thread overview]
Message-ID: <20120911072009.GC18243@pengutronix.de> (raw)
In-Reply-To: <1347341491-2647-1-git-send-email-alex.aring@gmail.com>

On Tue, Sep 11, 2012 at 07:31:31AM +0200, Alexander Aring wrote:
> Fix casting on min argument, to avoid warnings on 64bit build.
> 
> Signed-off-by: Alexander Aring <alex.aring@gmail.com>

Applied, thanks

Sascha

> ---
>  fs/fs.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/fs.c b/fs/fs.c
> index 38917bf..db4621a 100644
> --- a/fs/fs.c
> +++ b/fs/fs.c
> @@ -1525,7 +1525,9 @@ ssize_t mem_read(struct cdev *cdev, void *buf, size_t count, loff_t offset, ulon
>  		return -1;
>  	dev = cdev->dev;
>  
> -	size = min((loff_t)count, resource_size(&dev->resource[0]) - offset);
> +	size = min((resource_size_t)count,
> +			resource_size(&dev->resource[0]) -
> +			(resource_size_t)offset);
>  	memcpy_sz(buf, dev_get_mem_region(dev, 0) + offset, size, flags & O_RWSIZE_MASK);
>  	return size;
>  }
> @@ -1540,7 +1542,9 @@ ssize_t mem_write(struct cdev *cdev, const void *buf, size_t count, loff_t offse
>  		return -1;
>  	dev = cdev->dev;
>  
> -	size = min((loff_t)count, resource_size(&dev->resource[0]) - offset);
> +	size = min((resource_size_t)count,
> +			resource_size(&dev->resource[0]) -
> +			(resource_size_t)offset);
>  	memcpy_sz(dev_get_mem_region(dev, 0) + offset, buf, size, flags & O_RWSIZE_MASK);
>  	return size;
>  }
> -- 
> 1.7.12
> 
> 
> _______________________________________________
> 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-09-11  7:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-11  5:31 Alexander Aring
2012-09-11  7:20 ` 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=20120911072009.GC18243@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=alex.aring@googlemail.com \
    --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