aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorDarren Jenkins <darrenrjenkins@gmail.com>2006-10-10 17:20:35 -0400
committerLen Brown <len.brown@intel.com>2006-10-14 02:03:02 -0400
commit6311f0dac006032b82e3556874a1e18b31e80de2 (patch)
treefaf92a3869b1d798104dd9d7773a410628209901 /drivers/acpi
parent288f3ad406460f03642a41bb945826891a7b866f (diff)
ACPI: asus_acpi: fix proc files parsing
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> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/asus_acpi.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/drivers/acpi/asus_acpi.c b/drivers/acpi/asus_acpi.c
index ebc033f87e79..33eaca108f4b 100644
--- a/drivers/acpi/asus_acpi.c
+++ b/drivers/acpi/asus_acpi.c
@@ -567,11 +567,11 @@ static int
567write_led(const char __user * buffer, unsigned long count, 567write_led(const char __user * buffer, unsigned long count,
568 char *ledname, int ledmask, int invert) 568 char *ledname, int ledmask, int invert)
569{ 569{
570 int value; 570 int rv, value;
571 int led_out = 0; 571 int led_out = 0;
572 572
573 count = parse_arg(buffer, count, &value); 573 rv = parse_arg(buffer, count, &value);
574 if (count > 0) 574 if (rv > 0)
575 led_out = value ? 1 : 0; 575 led_out = value ? 1 : 0;
576 576
577 hotk->status = 577 hotk->status =
@@ -584,7 +584,7 @@ write_led(const char __user * buffer, unsigned long count,
584 printk(KERN_WARNING "Asus ACPI: LED (%s) write failed\n", 584 printk(KERN_WARNING "Asus ACPI: LED (%s) write failed\n",
585 ledname); 585 ledname);
586 586
587 return count; 587 return rv;
588} 588}
589 589
590/* 590/*
@@ -619,20 +619,20 @@ static int
619proc_write_ledd(struct file *file, const char __user * buffer, 619proc_write_ledd(struct file *file, const char __user * buffer,
620 unsigned long count, void *data) 620 unsigned long count, void *data)
621{ 621{
622 int value; 622 int rv, value;
623 623
624 count = parse_arg(buffer, count, &value); 624 rv = parse_arg(buffer, count, &value);
625 if (count > 0) { 625 if (rv > 0) {
626 if (!write_acpi_int 626 if (!write_acpi_int
627 (hotk->handle, hotk->methods->mt_ledd, value, NULL)) 627 (hotk->handle, hotk->methods->mt_ledd, value, NULL))
628 printk(KERN_WARNING 628 printk(KERN_WARNING
629 "Asus ACPI: LED display write failed\n"); 629 "Asus ACPI: LED display write failed\n");
630 else 630 else
631 hotk->ledd_status = (u32) value; 631 hotk->ledd_status = (u32) value;
632 } else if (count < 0) 632 } else if (rv < 0)
633 printk(KERN_WARNING "Asus ACPI: Error reading user input\n"); 633 printk(KERN_WARNING "Asus ACPI: Error reading user input\n");
634 634
635 return count; 635 return rv;
636} 636}
637 637
638/* 638/*
@@ -773,12 +773,12 @@ static int
773proc_write_lcd(struct file *file, const char __user * buffer, 773proc_write_lcd(struct file *file, const char __user * buffer,
774 unsigned long count, void *data) 774 unsigned long count, void *data)
775{ 775{
776 int value; 776 int rv, value;
777 777
778 count = parse_arg(buffer, count, &value); 778 rv = parse_arg(buffer, count, &value);
779 if (count > 0) 779 if (rv > 0)
780 set_lcd_state(value); 780 set_lcd_state(value);
781 return count; 781 return rv;
782} 782}
783 783
784static int read_brightness(void) 784static int read_brightness(void)
@@ -842,18 +842,18 @@ static int
842proc_write_brn(struct file *file, const char __user * buffer, 842proc_write_brn(struct file *file, const char __user * buffer,
843 unsigned long count, void *data) 843 unsigned long count, void *data)
844{ 844{
845 int value; 845 int rv, value;
846 846
847 count = parse_arg(buffer, count, &value); 847 rv = parse_arg(buffer, count, &value);
848 if (count > 0) { 848 if (rv > 0) {
849 value = (0 < value) ? ((15 < value) ? 15 : value) : 0; 849 value = (0 < value) ? ((15 < value) ? 15 : value) : 0;
850 /* 0 <= value <= 15 */ 850 /* 0 <= value <= 15 */
851 set_brightness(value); 851 set_brightness(value);
852 } else if (count < 0) { 852 } else if (rv < 0) {
853 printk(KERN_WARNING "Asus ACPI: Error reading user input\n"); 853 printk(KERN_WARNING "Asus ACPI: Error reading user input\n");
854 } 854 }
855 855
856 return count; 856 return rv;
857} 857}
858 858
859static void set_display(int value) 859static void set_display(int value)
@@ -892,15 +892,15 @@ static int
892proc_write_disp(struct file *file, const char __user * buffer, 892proc_write_disp(struct file *file, const char __user * buffer,
893 unsigned long count, void *data) 893 unsigned long count, void *data)
894{ 894{
895 int value; 895 int rv, value;
896 896
897 count = parse_arg(buffer, count, &value); 897 rv = parse_arg(buffer, count, &value);
898 if (count > 0) 898 if (rv > 0)
899 set_display(value); 899 set_display(value);
900 else if (count < 0) 900 else if (rv < 0)
901 printk(KERN_WARNING "Asus ACPI: Error reading user input\n"); 901 printk(KERN_WARNING "Asus ACPI: Error reading user input\n");
902 902
903 return count; 903 return rv;
904} 904}
905 905
906typedef int (proc_readfunc) (char *page, char **start, off_t off, int count, 906typedef int (proc_readfunc) (char *page, char **start, off_t off, int count,