linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Randy Dunlap <randy.dunlap@oracle.com>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
	linux-next@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	jeremy@xensource.com, chrisw@sous-sol.org
Subject: Re: linux-next: Tree for August 5 (XEN)
Date: Tue, 5 Aug 2008 19:30:34 -0700	[thread overview]
Message-ID: <20080805193034.de32bf52.randy.dunlap@oracle.com> (raw)
In-Reply-To: <4898FB2F.9060202@goop.org>

On Tue, 05 Aug 2008 18:15:27 -0700 Jeremy Fitzhardinge wrote:

> Randy Dunlap wrote:
> > These warnings have been around for several days now.
> > Is there a patch available but not yet merged for linux-next?
> >
> >
> > linux-next-20080805/drivers/xen/balloon.c:599: warning: initialization from incompatible pointer type
> > linux-next-20080805/drivers/xen/balloon.c:600: warning: initialization from incompatible pointer type
> > linux-next-20080805/drivers/xen/balloon.c:601: warning: initialization from incompatible pointer type
> > linux-next-20080805/drivers/xen/balloon.c:602: warning: initialization from incompatible pointer type
> > linux-next-20080805/drivers/xen/balloon.c:605: warning: initialization from incompatible pointer type
> > linux-next-20080805/drivers/xen/balloon.c:635: warning: initialization from incompatible pointer type
> >   
> 
> I posted this patch the other day.  It's in tip.git, but I guess it 
> hasn't made it to next.
> 

Ack, looks good, fixes those warnings.
Thanks.


> 
> Subject: xen-balloon: fix up sysfs issues
> 
> 1. Set the class so it doesn't clash with the normal memory class
> 2. Fix up the sysfs show functions to match the new prototype
> 3. Clean up use of memparse
> 
> Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
> Cc: viets@work.de
> Cc: Andi Kleen <andi@firstfloor.org>
> ---
>  drivers/xen/balloon.c |   27 ++++++++++++---------------
>  1 file changed, 12 insertions(+), 15 deletions(-)
> 
> ===================================================================
> --- a/drivers/xen/balloon.c
> +++ b/drivers/xen/balloon.c
> @@ -60,7 +60,7 @@
>  
>  #define PAGES2KB(_p) ((_p)<<(PAGE_SHIFT-10))
>  
> -#define BALLOON_CLASS_NAME "memory"
> +#define BALLOON_CLASS_NAME "xen_memory"
>  
>  struct balloon_stats {
>  	/* We aim for 'current allocation' == 'target allocation'. */
> @@ -588,12 +587,13 @@
>  }
>  
>  
> -#define BALLOON_SHOW(name, format, args...)			\
> -	static ssize_t show_##name(struct sys_device *dev,	\
> -				   char *buf)			\
> -	{							\
> -		return sprintf(buf, format, ##args);		\
> -	}							\
> +#define BALLOON_SHOW(name, format, args...)				\
> +	static ssize_t show_##name(struct sys_device *dev,		\
> +				   struct sysdev_attribute *attr,	\
> +				   char *buf)				\
> +	{								\
> +		return sprintf(buf, format, ##args);			\
> +	}								\
>  	static SYSDEV_ATTR(name, S_IRUGO, show_##name, NULL)
>  
>  BALLOON_SHOW(current_kb, "%lu\n", PAGES2KB(balloon_stats.current_pages));
> @@ -604,7 +604,8 @@
>  	     (balloon_stats.hard_limit!=~0UL) ? PAGES2KB(balloon_stats.hard_limit) : 0);
>  BALLOON_SHOW(driver_kb, "%lu\n", PAGES2KB(balloon_stats.driver_pages));
>  
> -static ssize_t show_target_kb(struct sys_device *dev, char *buf)
> +static ssize_t show_target_kb(struct sys_device *dev, struct sysdev_attribute *attr,
> +			      char *buf)
>  {
>  	return sprintf(buf, "%lu\n", PAGES2KB(balloon_stats.target_pages));
>  }
> @@ -614,19 +615,14 @@
>  			       const char *buf,
>  			       size_t count)
>  {
> -	char memstring[64], *endchar;
> +	char *endchar;
>  	unsigned long long target_bytes;
>  
>  	if (!capable(CAP_SYS_ADMIN))
>  		return -EPERM;
>  
> -	if (count <= 1)
> -		return -EBADMSG; /* runt */
> -	if (count > sizeof(memstring))
> -		return -EFBIG;   /* too long */
> -	strcpy(memstring, buf);
> +	target_bytes = memparse(buf, &endchar);
>  
> -	target_bytes = memparse(memstring, &endchar);
>  	balloon_set_new_target(target_bytes >> PAGE_SHIFT);
>  
>  	return count;
> 
> 


---
~Randy
Linux Plumbers Conference, 17-19 September 2008, Portland, Oregon USA
http://linuxplumbersconf.org/

  reply	other threads:[~2008-08-06  2:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-05  7:59 linux-next: Tree for August 5 Stephen Rothwell
2008-08-05 15:49 ` Stefan Richter
2008-08-05 15:55   ` David Woodhouse
2008-08-06  0:55 ` linux-next: Tree for August 5 (MTD build error) Randy Dunlap
     [not found]   ` <200808060320.20064.david-b@pacbell.net>
2008-08-06 11:13     ` David Brownell
2008-08-07  0:13       ` Randy Dunlap
2008-08-07  4:40       ` Stephen Rothwell
2008-08-07  8:26         ` David Woodhouse
2008-08-07 11:04           ` Stephen Rothwell
2008-08-06  1:03 ` linux-next: Tree for August 5 (XEN) Randy Dunlap
2008-08-06  1:15   ` Jeremy Fitzhardinge
2008-08-06  2:30     ` Randy Dunlap [this message]
2008-08-06  6:31     ` Stephen Rothwell

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=20080805193034.de32bf52.randy.dunlap@oracle.com \
    --to=randy.dunlap@oracle.com \
    --cc=chrisw@sous-sol.org \
    --cc=jeremy@goop.org \
    --cc=jeremy@xensource.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    /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).