rbd: Use min_t() to fix comparison of distinct pointer types warning
Subsystems (2)
PATCH 1/1 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.
--- drivers/block/rbd.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/block/rbd.c +2 -2
@@ -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);
Signature · 1 line
1.7.0.4
Quoted 4 lines · Geert Uytterhoeven
drivers/block/rbd.c: In function ‘zero_pages’:drivers/block/rbd.c:1102: warning: comparison of distinct pointer types lacks a castRemove the hackish casts and use
min_t()to fix this.
Looks good to me. I'm not sure why I didn't use that to begin with.
I'll pull this into the ceph tree. Thanks a lot.
Quoted 11 lines
Signed-off-by Geert Uytterhoeven <[email protected]>--- drivers/block/rbd.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)drivers/block/rbd.c +0
-0
drivers/block/rbd.c static void zero_pages(struct page **pages, u64 offset, u64 end) · line 1105
Quoted 10 lines
drivers/block/rbd.c +2
-2@@ -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);
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html