summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert@linux-m68k.org>2014-04-13 22:46:21 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-14 01:10:26 +0400
commite686bd8dc55ebd605b792632c415481fbc952458 (patch)
treefd50e93b4abb666d111d61f6543c20ee6e61557b /fs
parentbf3a340738bc78008e496257c04fb5a7fc8281e6 (diff)
downloadlinux-e686bd8dc55ebd605b792632c415481fbc952458.tar.xz
cifs: Use min_t() when comparing "size_t" and "unsigned long"
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 7f25bba819a3 ("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> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/file.c2
1 files changed, 1 insertions, 1 deletions
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)