From: Alex Elder <elder@inktank.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rbd: Use min_t() to fix comparison of distinct pointer types warning
Date: Wed, 08 May 2013 15:36:27 -0500 [thread overview]
Message-ID: <518AB74B.50401@inktank.com> (raw)
In-Reply-To: <1368043353-21896-1-git-send-email-geert@linux-m68k.org>
On 05/08/2013 03:02 PM, Geert Uytterhoeven wrote:
> 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.
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.
Reviewed-by: Alex Elder <elder@inktank.com>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---
> drivers/block/rbd.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
> index 22ffd5d..1318c6b 100644
> --- a/drivers/block/rbd.c
> +++ b/drivers/block/rbd.c
> @@ -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 majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: Alex Elder <elder@inktank.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rbd: Use min_t() to fix comparison of distinct pointer types warning
Date: Wed, 08 May 2013 15:36:27 -0500 [thread overview]
Message-ID: <518AB74B.50401@inktank.com> (raw)
In-Reply-To: <1368043353-21896-1-git-send-email-geert@linux-m68k.org>
On 05/08/2013 03:02 PM, Geert Uytterhoeven wrote:
> 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.
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.
Reviewed-by: Alex Elder <elder@inktank.com>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---
> drivers/block/rbd.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
> index 22ffd5d..1318c6b 100644
> --- a/drivers/block/rbd.c
> +++ b/drivers/block/rbd.c
> @@ -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);
>
next prev parent reply other threads:[~2013-05-08 20:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-08 20:02 [PATCH] rbd: Use min_t() to fix comparison of distinct pointer types warning Geert Uytterhoeven
2013-05-08 20:36 ` Alex Elder [this message]
2013-05-08 20:36 ` Alex Elder
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=518AB74B.50401@inktank.com \
--to=elder@inktank.com \
--cc=ceph-devel@vger.kernel.org \
--cc=geert@linux-m68k.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.