Skip to content

Commit

Permalink
rbd: Use min_t() to fix comparison of distinct pointer types warning
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Alex Elder <[email protected]>
  • Loading branch information
geertu authored and Sage Weil committed Jul 1, 2013
1 parent 8bb495e commit 491205a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1153,8 +1153,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);
Expand Down

0 comments on commit 491205a

Please sign in to comment.