From: Geert Uytterhoeven Date: Tue, 14 May 2013 01:35:37 +0000 (-0500) Subject: rbd: Use min_t() to fix comparison of distinct pointer types warning X-Git-Tag: next-20130617~100^2~26 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ed9e1c4dfcc71f70f53d78b388697d6f7e6e1329;p=karo-tx-linux.git rbd: Use min_t() to fix comparison of distinct pointer types warning 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 --- diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index cc7c60e8f277..488c74cbfc7b 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -1155,8 +1155,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);