Commit 491205a8 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Sage Weil

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: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: default avatarAlex Elder <elder@inktank.com>
parent 8bb495e3
...@@ -1153,8 +1153,8 @@ static void zero_pages(struct page **pages, u64 offset, u64 end) ...@@ -1153,8 +1153,8 @@ static void zero_pages(struct page **pages, u64 offset, u64 end)
unsigned long flags; unsigned long flags;
void *kaddr; void *kaddr;
page_offset = (size_t)(offset & ~PAGE_MASK); page_offset = offset & ~PAGE_MASK;
length = min(PAGE_SIZE - page_offset, (size_t)(end - offset)); length = min_t(size_t, PAGE_SIZE - page_offset, end - offset);
local_irq_save(flags); local_irq_save(flags);
kaddr = kmap_atomic(*page); kaddr = kmap_atomic(*page);
memset(kaddr + page_offset, 0, length); memset(kaddr + page_offset, 0, length);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment