From patchwork Sun Apr 13 18:46:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 3974651 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DD2B7BFF02 for ; Sun, 13 Apr 2014 18:47:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E3F8220259 for ; Sun, 13 Apr 2014 18:47:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 166EE20251 for ; Sun, 13 Apr 2014 18:47:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754977AbaDMSqc (ORCPT ); Sun, 13 Apr 2014 14:46:32 -0400 Received: from albert.telenet-ops.be ([195.130.137.90]:50754 "EHLO albert.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754814AbaDMSqb (ORCPT ); Sun, 13 Apr 2014 14:46:31 -0400 Received: from ayla.of.borg ([84.193.72.141]) by albert.telenet-ops.be with bizsmtp id pWmU1n00N32ts5g06WmU9D; Sun, 13 Apr 2014 20:46:29 +0200 Received: from geert by ayla.of.borg with local (Exim 4.76) (envelope-from ) id 1WZPQC-0007Jp-8V; Sun, 13 Apr 2014 20:46:28 +0200 From: Geert Uytterhoeven To: Linus Torvalds , Alexander Viro , Andrew Morton Cc: Steve French , linux-cifs@vger.kernel.org, Hugh Dickins , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 1/2] cifs: Use min_t() when comparing "size_t" and "unsigned long" Date: Sun, 13 Apr 2014 20:46:21 +0200 Message-Id: <1397414783-28098-1-git-send-email-geert@linux-m68k.org> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Jeff Layton --- 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)