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 12:33:24 +0000 (15:33 +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 8eaadbaf8ffa5281d6db62f9f9152c783e0c69c8..0f704484ae1d6b7a4d6fc7abb08fb3f268d1dce1 100644 (file)
@@ -9548,7 +9548,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;