virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <aliguori@us.ibm.com>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: virtualization@lists.linux-foundation.org
Subject: Re: [PATCH] Fix compile warnings in virtio_balloon
Date: Fri, 25 Jan 2008 09:29:43 -0600	[thread overview]
Message-ID: <479A0067.4010409@us.ibm.com> (raw)
In-Reply-To: <200801251009.14305.rusty@rustcorp.com.au>

Rusty Russell wrote:
> On Friday 25 January 2008 07:03:18 Anthony Liguori wrote:
>   
>> On x86_64, min was throwing a warning.  ARRAY_SIZE is unsigned long so
>> let's switch to using that for num.
>>     
>
> Creates warning on 32-bit.
>
> How about this?
>   
Yeah, that's fine.

Regards,

Anthony Liguori
> ===
>
> On x86_64, min was throwing a warning.  size_t is correct for 32 and 64.
>
> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
>
> diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
> --- a/drivers/virtio/virtio_balloon.c
> +++ b/drivers/virtio/virtio_balloon.c
> @@ -82,7 +82,7 @@ static void tell_host(struct virtio_ball
>  	wait_for_completion(&vb->acked);
>  }
>
> -static void fill_balloon(struct virtio_balloon *vb, unsigned int num)
> +static void fill_balloon(struct virtio_balloon *vb, size_t num)
>  {
>  	/* We can only do one array worth at a time. */
>  	num = min(num, ARRAY_SIZE(vb->pfns));
> @@ -92,7 +92,7 @@ static void fill_balloon(struct virtio_b
>  		if (!page) {
>  			if (printk_ratelimit())
>  				dev_printk(KERN_INFO, &vb->vdev->dev,
> -					   "Out of puff! Can't get %u pages\n",
> +					   "Out of puff! Can't get %zu pages\n",
>  					   num);
>  			/* Sleep for at least 1/5 of a second before retry. */
>  			msleep(200);
> @@ -121,7 +121,7 @@ static void release_pages_by_pfn(const u
>  	}
>  }
>
> -static void leak_balloon(struct virtio_balloon *vb, unsigned int num)
> +static void leak_balloon(struct virtio_balloon *vb, size_t num)
>  {
>  	struct page *page;
>
>   

      reply	other threads:[~2008-01-25 15:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-24 20:03 [PATCH] Fix compile warnings in virtio_balloon Anthony Liguori
2008-01-24 22:14 ` Anthony Liguori
2008-01-24 23:09 ` Rusty Russell
2008-01-25 15:29   ` Anthony Liguori [this message]

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=479A0067.4010409@us.ibm.com \
    --to=aliguori@us.ibm.com \
    --cc=rusty@rustcorp.com.au \
    --cc=virtualization@lists.linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).