All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 05/12] asus_acpi: fix proc files parsing
@ 2006-10-10 21:20 akpm
  2006-10-14  8:07 ` Len Brown
  0 siblings, 1 reply; 2+ messages in thread
From: akpm @ 2006-10-10 21:20 UTC (permalink / raw)
  To: len.brown; +Cc: linux-acpi, akpm, darrenrjenkins, adobriyan

From: Darren Jenkins <darrenrjenkins@gmail.com>

ICC complains about a "Pointless comparsion of unsigned interger with zero"
@ line 760 & 808 of asus_acpi.c

parse_arg() mentioned below returns -E but it's copied into unsigned variable...

Signed-off-by: Darren Jenkins <darrenrjenkins@gmail.com>
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 drivers/acpi/asus_acpi.c |   46 ++++++++++++++++++-------------------
 1 files changed, 23 insertions(+), 23 deletions(-)

diff -puN drivers/acpi/asus_acpi.c~asus_acpi-fix-proc-files-parsing drivers/acpi/asus_acpi.c
--- a/drivers/acpi/asus_acpi.c~asus_acpi-fix-proc-files-parsing
+++ a/drivers/acpi/asus_acpi.c
@@ -567,11 +567,11 @@ static int
 write_led(const char __user * buffer, unsigned long count,
 	  char *ledname, int ledmask, int invert)
 {
-	int value;
+	int rv, value;
 	int led_out = 0;
 
-	count = parse_arg(buffer, count, &value);
-	if (count > 0)
+	rv = parse_arg(buffer, count, &value);
+	if (rv > 0)
 		led_out = value ? 1 : 0;
 
 	hotk->status =
@@ -584,7 +584,7 @@ write_led(const char __user * buffer, un
 		printk(KERN_WARNING "Asus ACPI: LED (%s) write failed\n",
 		       ledname);
 
-	return count;
+	return rv;
 }
 
 /*
@@ -619,20 +619,20 @@ static int
 proc_write_ledd(struct file *file, const char __user * buffer,
 		unsigned long count, void *data)
 {
-	int value;
+	int rv, value;
 
-	count = parse_arg(buffer, count, &value);
-	if (count > 0) {
+	rv = parse_arg(buffer, count, &value);
+	if (rv > 0) {
 		if (!write_acpi_int
 		    (hotk->handle, hotk->methods->mt_ledd, value, NULL))
 			printk(KERN_WARNING
 			       "Asus ACPI: LED display write failed\n");
 		else
 			hotk->ledd_status = (u32) value;
-	} else if (count < 0)
+	} else if (rv < 0)
 		printk(KERN_WARNING "Asus ACPI: Error reading user input\n");
 
-	return count;
+	return rv;
 }
 
 /*
@@ -773,12 +773,12 @@ static int
 proc_write_lcd(struct file *file, const char __user * buffer,
 	       unsigned long count, void *data)
 {
-	int value;
+	int rv, value;
 
-	count = parse_arg(buffer, count, &value);
-	if (count > 0)
+	rv = parse_arg(buffer, count, &value);
+	if (rv > 0)
 		set_lcd_state(value);
-	return count;
+	return rv;
 }
 
 static int read_brightness(void)
@@ -842,18 +842,18 @@ static int
 proc_write_brn(struct file *file, const char __user * buffer,
 	       unsigned long count, void *data)
 {
-	int value;
+	int rv, value;
 
-	count = parse_arg(buffer, count, &value);
-	if (count > 0) {
+	rv = parse_arg(buffer, count, &value);
+	if (rv > 0) {
 		value = (0 < value) ? ((15 < value) ? 15 : value) : 0;
 		/* 0 <= value <= 15 */
 		set_brightness(value);
-	} else if (count < 0) {
+	} else if (rv < 0) {
 		printk(KERN_WARNING "Asus ACPI: Error reading user input\n");
 	}
 
-	return count;
+	return rv;
 }
 
 static void set_display(int value)
@@ -892,15 +892,15 @@ static int
 proc_write_disp(struct file *file, const char __user * buffer,
 		unsigned long count, void *data)
 {
-	int value;
+	int rv, value;
 
-	count = parse_arg(buffer, count, &value);
-	if (count > 0)
+	rv = parse_arg(buffer, count, &value);
+	if (rv > 0)
 		set_display(value);
-	else if (count < 0)
+	else if (rv < 0)
 		printk(KERN_WARNING "Asus ACPI: Error reading user input\n");
 
-	return count;
+	return rv;
 }
 
 typedef int (proc_readfunc) (char *page, char **start, off_t off, int count,
_

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch 05/12] asus_acpi: fix proc files parsing
  2006-10-10 21:20 [patch 05/12] asus_acpi: fix proc files parsing akpm
@ 2006-10-14  8:07 ` Len Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Len Brown @ 2006-10-14  8:07 UTC (permalink / raw)
  To: akpm; +Cc: linux-acpi, darrenrjenkins, adobriyan

Applied.

thanks,
-Len

On Tuesday 10 October 2006 17:20, akpm@osdl.org wrote:
> From: Darren Jenkins <darrenrjenkins@gmail.com>
> 
> ICC complains about a "Pointless comparsion of unsigned interger with zero"
> @ line 760 & 808 of asus_acpi.c
> 
> parse_arg() mentioned below returns -E but it's copied into unsigned variable...
> 
> Signed-off-by: Darren Jenkins <darrenrjenkins@gmail.com>
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
> Signed-off-by: Andrew Morton <akpm@osdl.org>
> ---
> 
>  drivers/acpi/asus_acpi.c |   46 ++++++++++++++++++-------------------
>  1 files changed, 23 insertions(+), 23 deletions(-)
> 
> diff -puN drivers/acpi/asus_acpi.c~asus_acpi-fix-proc-files-parsing drivers/acpi/asus_acpi.c
> --- a/drivers/acpi/asus_acpi.c~asus_acpi-fix-proc-files-parsing
> +++ a/drivers/acpi/asus_acpi.c
> @@ -567,11 +567,11 @@ static int
>  write_led(const char __user * buffer, unsigned long count,
>  	  char *ledname, int ledmask, int invert)
>  {
> -	int value;
> +	int rv, value;
>  	int led_out = 0;
>  
> -	count = parse_arg(buffer, count, &value);
> -	if (count > 0)
> +	rv = parse_arg(buffer, count, &value);
> +	if (rv > 0)
>  		led_out = value ? 1 : 0;
>  
>  	hotk->status =
> @@ -584,7 +584,7 @@ write_led(const char __user * buffer, un
>  		printk(KERN_WARNING "Asus ACPI: LED (%s) write failed\n",
>  		       ledname);
>  
> -	return count;
> +	return rv;
>  }
>  
>  /*
> @@ -619,20 +619,20 @@ static int
>  proc_write_ledd(struct file *file, const char __user * buffer,
>  		unsigned long count, void *data)
>  {
> -	int value;
> +	int rv, value;
>  
> -	count = parse_arg(buffer, count, &value);
> -	if (count > 0) {
> +	rv = parse_arg(buffer, count, &value);
> +	if (rv > 0) {
>  		if (!write_acpi_int
>  		    (hotk->handle, hotk->methods->mt_ledd, value, NULL))
>  			printk(KERN_WARNING
>  			       "Asus ACPI: LED display write failed\n");
>  		else
>  			hotk->ledd_status = (u32) value;
> -	} else if (count < 0)
> +	} else if (rv < 0)
>  		printk(KERN_WARNING "Asus ACPI: Error reading user input\n");
>  
> -	return count;
> +	return rv;
>  }
>  
>  /*
> @@ -773,12 +773,12 @@ static int
>  proc_write_lcd(struct file *file, const char __user * buffer,
>  	       unsigned long count, void *data)
>  {
> -	int value;
> +	int rv, value;
>  
> -	count = parse_arg(buffer, count, &value);
> -	if (count > 0)
> +	rv = parse_arg(buffer, count, &value);
> +	if (rv > 0)
>  		set_lcd_state(value);
> -	return count;
> +	return rv;
>  }
>  
>  static int read_brightness(void)
> @@ -842,18 +842,18 @@ static int
>  proc_write_brn(struct file *file, const char __user * buffer,
>  	       unsigned long count, void *data)
>  {
> -	int value;
> +	int rv, value;
>  
> -	count = parse_arg(buffer, count, &value);
> -	if (count > 0) {
> +	rv = parse_arg(buffer, count, &value);
> +	if (rv > 0) {
>  		value = (0 < value) ? ((15 < value) ? 15 : value) : 0;
>  		/* 0 <= value <= 15 */
>  		set_brightness(value);
> -	} else if (count < 0) {
> +	} else if (rv < 0) {
>  		printk(KERN_WARNING "Asus ACPI: Error reading user input\n");
>  	}
>  
> -	return count;
> +	return rv;
>  }
>  
>  static void set_display(int value)
> @@ -892,15 +892,15 @@ static int
>  proc_write_disp(struct file *file, const char __user * buffer,
>  		unsigned long count, void *data)
>  {
> -	int value;
> +	int rv, value;
>  
> -	count = parse_arg(buffer, count, &value);
> -	if (count > 0)
> +	rv = parse_arg(buffer, count, &value);
> +	if (rv > 0)
>  		set_display(value);
> -	else if (count < 0)
> +	else if (rv < 0)
>  		printk(KERN_WARNING "Asus ACPI: Error reading user input\n");
>  
> -	return count;
> +	return rv;
>  }
>  
>  typedef int (proc_readfunc) (char *page, char **start, off_t off, int count,
> _
> -
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-10-14  8:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-10 21:20 [patch 05/12] asus_acpi: fix proc files parsing akpm
2006-10-14  8:07 ` Len Brown

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.