From patchwork Wed May 8 20:02:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 2541541 Return-Path: X-Original-To: patchwork-ceph-devel@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 F34993FC5A for ; Wed, 8 May 2013 20:02:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755257Ab3EHUCh (ORCPT ); Wed, 8 May 2013 16:02:37 -0400 Received: from gerard.telenet-ops.be ([195.130.132.48]:40934 "EHLO gerard.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752731Ab3EHUCh (ORCPT ); Wed, 8 May 2013 16:02:37 -0400 Received: from ayla.of.borg ([84.193.72.141]) by gerard.telenet-ops.be with bizsmtp id ZY2b1l00732ts5g0HY2bpb; Wed, 08 May 2013 22:02:35 +0200 Received: from geert by ayla.of.borg with local (Exim 4.71) (envelope-from ) id 1UaAZO-0005hd-VG; Wed, 08 May 2013 22:02:34 +0200 From: Geert Uytterhoeven To: Alex Elder Cc: ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] rbd: Use min_t() to fix comparison of distinct pointer types warning Date: Wed, 8 May 2013 22:02:33 +0200 Message-Id: <1368043353-21896-1-git-send-email-geert@linux-m68k.org> X-Mailer: git-send-email 1.7.0.4 MIME-Version: 1.0 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org drivers/block/rbd.c: In function ‘zero_pages’: drivers/block/rbd.c:1102: warning: comparison of distinct pointer types lacks a cast Remove the hackish casts and use min_t() to fix this. Signed-off-by: Geert Uytterhoeven Reviewed-by: Alex Elder --- drivers/block/rbd.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 22ffd5d..1318c6b 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -1098,8 +1098,8 @@ static void zero_pages(struct page **pages, u64 offset, u64 end) unsigned long flags; void *kaddr; - page_offset = (size_t)(offset & ~PAGE_MASK); - length = min(PAGE_SIZE - page_offset, (size_t)(end - offset)); + page_offset = offset & ~PAGE_MASK; + length = min_t(size_t, PAGE_SIZE - page_offset, end - offset); local_irq_save(flags); kaddr = kmap_atomic(*page); memset(kaddr + page_offset, 0, length);