]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
rbd: Use min_t() to fix comparison of distinct pointer types warning
authorGeert Uytterhoeven <geert@linux-m68k.org>
Tue, 14 May 2013 01:35:37 +0000 (20:35 -0500)
committerSage Weil <sage@inktank.com>
Thu, 13 Jun 2013 15:46:15 +0000 (08:46 -0700)
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 <geert@linux-m68k.org>
Reviewed-by: Alex Elder <elder@inktank.com>
drivers/block/rbd.c

index cc7c60e8f277805c0dff71be8fbf49f26dbd8e1d..488c74cbfc7b7c25ad7a41fc5b335f44bd06aa9e 100644 (file)
@@ -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);