From: Jeff Layton <jlayton@poochiereds.net>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Andrew Morton <akpm@linux-foundation.org>,
Steve French <sfrench@samba.org>,
linux-cifs@vger.kernel.org, Hugh Dickins <hughd@google.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] cifs: Use min_t() when comparing "size_t" and "unsigned long"
Date: Fri, 2 May 2014 15:55:25 -0400 [thread overview]
Message-ID: <20140502155525.02dde4de@tlielax.poochiereds.net> (raw)
In-Reply-To: <1397414783-28098-1-git-send-email-geert@linux-m68k.org>
On Sun, 13 Apr 2014 20:46:21 +0200
Geert Uytterhoeven <geert@linux-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@linux-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@poochiereds.net>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2014-05-02 19:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-13 18:46 Geert Uytterhoeven
2014-04-13 18:46 ` [PATCH 2/2] mm: Initialize error in shmem_file_aio_read() Geert Uytterhoeven
[not found] ` <1397414783-28098-2-git-send-email-geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
2014-04-13 20:50 ` Al Viro
2014-05-02 19:55 ` Jeff Layton [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=20140502155525.02dde4de@tlielax.poochiereds.net \
--to=jlayton@poochiereds.net \
--cc=akpm@linux-foundation.org \
--cc=geert@linux-m68k.org \
--cc=hughd@google.com \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=sfrench@samba.org \
--cc=torvalds@linux-foundation.org \
--cc=viro@zeniv.linux.org.uk \
/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