ia64/xen-unstable

changeset 10166:e336c37b8de0

Fix kcons_write and kcons_write_dom0 CodingStyle.
Use roundup_pow_of_two().

Signed-off-by: Chris Wright <chrisw@sous-sol.org>
author kaf24@firebug.cl.cam.ac.uk
date Wed May 24 11:57:37 2006 +0100 (2006-05-24)
parents 84dd753a9247
children 52cec91b7560
files linux-2.6-xen-sparse/drivers/xen/console/console.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/console/console.c	Wed May 24 11:56:40 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/console/console.c	Wed May 24 11:57:37 2006 +0100
     1.3 @@ -117,8 +117,11 @@ static int __init xencons_bufsz_setup(ch
     1.4  {
     1.5  	unsigned int goal;
     1.6  	goal = simple_strtoul(str, NULL, 0);
     1.7 -	while (wbuf_size < goal)
     1.8 -		wbuf_size <<= 1;
     1.9 +	if (goal) {
    1.10 +		goal = roundup_pow_of_two(goal);
    1.11 +		if (wbuf_size < goal)
    1.12 +			wbuf_size = goal;
    1.13 +	}
    1.14  	return 1;
    1.15  }
    1.16  __setup("xencons_bufsz=", xencons_bufsz_setup);
    1.17 @@ -133,8 +136,7 @@ static struct tty_driver *xencons_driver
    1.18  
    1.19  /******************** Kernel console driver ********************************/
    1.20  
    1.21 -static void kcons_write(
    1.22 -	struct console *c, const char *s, unsigned int count)
    1.23 +static void kcons_write(struct console *c, const char *s, unsigned int count)
    1.24  {
    1.25  	int           i = 0;
    1.26  	unsigned long flags;
    1.27 @@ -155,14 +157,14 @@ static void kcons_write(
    1.28  	spin_unlock_irqrestore(&xencons_lock, flags);
    1.29  }
    1.30  
    1.31 -static void kcons_write_dom0(
    1.32 -	struct console *c, const char *s, unsigned int count)
    1.33 +static void kcons_write_dom0(struct console *c, const char *s, unsigned int count)
    1.34  {
    1.35 -	int rc;
    1.36  
    1.37 -	while ((count > 0) &&
    1.38 -	       ((rc = HYPERVISOR_console_io(
    1.39 -			CONSOLEIO_write, count, (char *)s)) > 0)) {
    1.40 +	while (count > 0) {
    1.41 +		int rc;
    1.42 +		rc = HYPERVISOR_console_io( CONSOLEIO_write, count, (char *)s);
    1.43 +		if (rc <= 0)
    1.44 +			break;
    1.45  		count -= rc;
    1.46  		s += rc;
    1.47  	}