Skip to content

Commit e686bd8

Browse files
geertutorvalds
authored andcommitted
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 7f25bba ("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 <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent bf3a340 commit e686bd8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/cifs/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2754,7 +2754,7 @@ cifs_readdata_to_iov(struct cifs_readdata *rdata, struct iov_iter *iter)
27542754

27552755
for (i = 0; i < rdata->nr_pages; i++) {
27562756
struct page *page = rdata->pages[i];
2757-
size_t copy = min(remaining, PAGE_SIZE);
2757+
size_t copy = min_t(size_t, remaining, PAGE_SIZE);
27582758
size_t written = copy_page_to_iter(page, 0, copy, iter);
27592759
remaining -= written;
27602760
if (written < copy && iov_iter_count(iter) > 0)

0 commit comments

Comments
 (0)