]> git.baikalelectronics.ru Git - kernel.git/commitdiff
platform/x86: thinkpad_acpi: Remove always false 'value < 0' statement
authorXiongfeng Wang <wangxiongfeng2@huawei.com>
Wed, 29 Apr 2020 08:59:40 +0000 (16:59 +0800)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 5 May 2020 17:26:16 +0000 (20:26 +0300)
Since 'value' is declared as unsigned long, the following statement is
always false.
value < 0

So let's remove it.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/platform/x86/thinkpad_acpi.c

index 83b4a83da967dcb0760bcf86c67a7324e4798bae..31377629ea575f97a0e574cf094b9388c8e5d6c0 100644 (file)
@@ -9579,7 +9579,7 @@ static ssize_t tpacpi_battery_store(int what,
                if (!battery_info.batteries[battery].start_support)
                        return -ENODEV;
                /* valid values are [0, 99] */
-               if (value < 0 || value > 99)
+               if (value > 99)
                        return -EINVAL;
                if (value > battery_info.batteries[battery].charge_stop)
                        return -EINVAL;