From patchwork Thu Sep 20 20:33:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Zach Brown X-Patchwork-Id: 1487751 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 7EC393FE65 for ; Thu, 20 Sep 2012 20:33:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753562Ab2ITUdH (ORCPT ); Thu, 20 Sep 2012 16:33:07 -0400 Received: from tetsuo.zabbo.net ([50.193.208.193]:54787 "EHLO tetsuo.zabbo.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753123Ab2ITUdG (ORCPT ); Thu, 20 Sep 2012 16:33:06 -0400 Received: from lenny.home.zabbo.net (unknown [192.168.242.141]) by tetsuo.zabbo.net (Postfix) with ESMTP id 84C3572001C8 for ; Thu, 20 Sep 2012 13:33:04 -0700 (PDT) From: Zach Brown To: linux-btrfs@vger.kernel.org Subject: [PATCH] btrfs: fix min csum item size warnings in 32bit Date: Thu, 20 Sep 2012 13:33:00 -0700 Message-Id: X-Mailer: git-send-email 1.7.6.5 MIME-Version: 1.0 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org commit 7ca4be45a0255ac8f08c05491c6add2dd87dd4f8 limited csum items to PAGE_CACHE_SIZE. It used min() with incompatible types in 32bit which generates warnings: fs/btrfs/file-item.c: In function ‘btrfs_csum_file_blocks’: fs/btrfs/file-item.c:717: warning: comparison of distinct pointer types lacks a cast This uses min_t(u32,) to fix the warnings. u32 seemed reasonable because btrfs_root->leafsize is u32 and PAGE_CACHE_SIZE is unsigned long. Signed-off-by: Zach Brown --- fs/btrfs/file-item.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c index 857d93c..2477e88 100644 --- a/fs/btrfs/file-item.c +++ b/fs/btrfs/file-item.c @@ -29,7 +29,8 @@ sizeof(struct btrfs_item) * 2) / \ size) - 1)) -#define MAX_CSUM_ITEMS(r, size) (min(__MAX_CSUM_ITEMS(r, size), PAGE_CACHE_SIZE)) +#define MAX_CSUM_ITEMS(r, size) (min_t(u32, __MAX_CSUM_ITEMS(r, size), \ + PAGE_CACHE_SIZE)) #define MAX_ORDERED_SUM_BYTES(r) ((PAGE_SIZE - \ sizeof(struct btrfs_ordered_sum)) / \