Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp394795ybz; Wed, 29 Apr 2020 02:07:57 -0700 (PDT) X-Google-Smtp-Source: APiQypKnLeWJ0xsI+USrx+4cvyHbvVj94x3OepIcEexhJMjpWVoQoveUpaK52MtbE/ZDBf9t/cUb X-Received: by 2002:a50:d987:: with SMTP id w7mr1459693edj.276.1588151277439; Wed, 29 Apr 2020 02:07:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588151277; cv=none; d=google.com; s=arc-20160816; b=iRlcSiCi4rWaKsiHssrIFFGJ5WGG24gkN2ioYbL3J6dIO9lAkaig97OFQrATyMdZEJ P0yCoKzg2GsQLQORIbeslgj+r0KiuTsO3TIbyDuAV6YmdEMEFAl8OZWQuOeMiErqApk/ JYLLNZtUeJYa9mXNgdBrXPhVR2J5ULIgsG9IFMQr14lhYucQImaM051wNF9f72Dwy8mk NLLTbD+DknxpSr8xqQPcjry9Xu991dGioDuC4zyD4t2y+p5HArlmBTY30Dn+dwIJljH7 XpZ5pI4O3CaXFHyPNTFLtka+GIVBWW3tYr8OEBnnPR3uK2iACu3t8eWuVrXshoZ5H/rn w/gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:to :from; bh=fXj6+VRUGuQvSpEHbEEeusJsjgddLaTVkgFJ6rPXIWc=; b=wYZWjcDvKLq0wza8np7HJDF0ujiMJnDM6pI4eT6o9WGMii+gLpMBwUXa+7+m7GHd4B VGjKokNeawZilrtWfaZ0LiQApyilZvqiLCajH6uZEqGVVTczECZEGa1jCB7eVDnvPcsn SuejYPm0P7n8J683n41I5DPVRwqCG2Dd2enTiwC0QX8gSEwSRXFd/UF669Of0IDKxNOD 80vJyWObZ7575doIgYG6XEqKig08hPcUaRrQTp3+iQrZhrdAznS8w879KIPpuwbV1uf9 q2TnD96In65wUeRnfQrFMcr2iidVHgg4BlFgFBhyYiURqaJQlahxnOXpDBb6Ld411lRU /1bg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l22si3556235ejg.362.2020.04.29.02.07.33; Wed, 29 Apr 2020 02:07:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726535AbgD2JFo (ORCPT + 99 others); Wed, 29 Apr 2020 05:05:44 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:3338 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726423AbgD2JFo (ORCPT ); Wed, 29 Apr 2020 05:05:44 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 9925BE945948337D28CD; Wed, 29 Apr 2020 17:05:41 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.487.0; Wed, 29 Apr 2020 17:05:32 +0800 From: Xiongfeng Wang To: , , , , , , Subject: [PATCH] platform/x86: thinkpad_acpi: Remove always false 'value < 0' statement Date: Wed, 29 Apr 2020 16:59:40 +0800 Message-ID: <1588150780-53718-1-git-send-email-wangxiongfeng2@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since 'value' is declared as unsigned long, the following statement is always false. value < 0 So let's remove it. Reported-by: Hulk Robot Signed-off-by: Xiongfeng Wang --- drivers/platform/x86/thinkpad_acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 8eaadba..0f70448 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -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; -- 1.7.12.4