lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Fri, 2 May 2014 15:55:25 -0400
From:	Jeff Layton <jlayton@...chiereds.net>
To:	Geert Uytterhoeven <geert@...ux-m68k.org>
Cc:	Linus Torvalds <torvalds@...ux-foundation.org>,
	Alexander Viro <viro@...iv.linux.org.uk>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Steve French <sfrench@...ba.org>, linux-cifs@...r.kernel.org,
	Hugh Dickins <hughd@...gle.com>, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] cifs: Use min_t() when comparing "size_t" and
 "unsigned long"

On Sun, 13 Apr 2014 20:46:21 +0200
Geert Uytterhoeven <geert@...ux-m68k.org> wrote:

> On 32 bit, size_t is "unsigned int", not "unsigned long", causing the
> following warning when comparing with PAGE_SIZE, which is always "unsigned
> long":
> 
> fs/cifs/file.c: In function ‘cifs_readdata_to_iov’:
> fs/cifs/file.c:2757: warning: comparison of distinct pointer types lacks a cast
> 
> Introduced by commit 7f25bba819a38ab7310024a9350655f374707e20
> ("cifs_iovec_read: keep iov_iter between the calls of
> cifs_readdata_to_iov()"), which changed the signedness of "remaining"
> and the code from min_t() to min().
> 
> Signed-off-by: Geert Uytterhoeven <geert@...ux-m68k.org>
> ---
> PAGE_SIZE should really be size_t, but that would require lots of changes
> all over the place.
> 
>  fs/cifs/file.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/cifs/file.c b/fs/cifs/file.c
> index 8807442c94dd..8add25538a3b 100644
> --- a/fs/cifs/file.c
> +++ b/fs/cifs/file.c
> @@ -2754,7 +2754,7 @@ cifs_readdata_to_iov(struct cifs_readdata *rdata, struct iov_iter *iter)
>  
>  	for (i = 0; i < rdata->nr_pages; i++) {
>  		struct page *page = rdata->pages[i];
> -		size_t copy = min(remaining, PAGE_SIZE);
> +		size_t copy = min_t(size_t, remaining, PAGE_SIZE);
>  		size_t written = copy_page_to_iter(page, 0, copy, iter);
>  		remaining -= written;
>  		if (written < copy && iov_iter_count(iter) > 0)

Reviewed-by: Jeff Layton <jlayton@...chiereds.net>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ