Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp298555pxb; Wed, 25 Aug 2021 03:39:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqfOXf1rvTxAt/vLKk2kRO7J6KUjziOiFM+JRcsnLh8oDo7pQGAIAzN74HRs08QfP50UQ6 X-Received: by 2002:a05:6e02:1d9e:: with SMTP id h30mr21045274ila.195.1629887983201; Wed, 25 Aug 2021 03:39:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629887983; cv=none; d=google.com; s=arc-20160816; b=lFvG08wnuNaDuADQkx7Cjcjt2Ow0r+0WjqnzycA+HkEEYsVRB29aNc0Wyy7ii0LRSX uJd+dyQvuK33wyYc9fB2xWWkvpW0lgZDmkGKEke4D1a4qQhaQklnndGFgHAtNEJGqj8h ilq0Nl5MtyIG/t+pbJPECNkD33vZzJLaC0NFLwaQejSXlB/sAiJVSxWpbejnhAgrvNOm S8zTNlAy1WFvivt1krCkcA1Rp9tnF9KZ/5CeSdb/b6aMYi9o+apVsgtf+vR1+hwAyv0N +KqzXDyA/4RLTAg2HK/yhksCCDkaTOIlBIByyra8QWu90xrgn6/820jbRGFpQuOSs3Ek 6kgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=sOeBsvVL5WWRWNnDrUrkMbyywe579diYAUtnG59XFUU=; b=DI8dYit/+edCDSdX5pDqRAkOgExLeyJqxj3Gsn2QTbUFpuYahSUJMm3UxufuHcsuEf JyhSxQVHTF3e9err7POUC9zT6bCAh1IpVwzBjqja0sx5OiVpdahz2PEKt4OuQFDRh7HQ GNoUMq3XXFktzmAs+P7B66OZnffQrYBuDRBlBy4a7WuW9gH6F++pf0tZ7IVQs4/kAZjm pqmGOjjjYUJuUcZ5JssnJGjOrPOgIk+l9/6cQEZG2NXicwdOecB41th+wXkhcdueNSdD TokilO1pwwY77wIV7GmWvudgNRAKIRq43OClYXxYJvNeisCqOYXH0fIhvw02ao9A/Ogl 9Org== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q4si22752185jaj.45.2021.08.25.03.39.31; Wed, 25 Aug 2021 03:39:43 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239184AbhHYKjV (ORCPT + 99 others); Wed, 25 Aug 2021 06:39:21 -0400 Received: from out4436.biz.mail.alibaba.com ([47.88.44.36]:22226 "EHLO out4436.biz.mail.alibaba.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239838AbhHYKjP (ORCPT ); Wed, 25 Aug 2021 06:39:15 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R131e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04426;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=9;SR=0;TI=SMTPD_---0UlnIh7o_1629887828; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0UlnIh7o_1629887828) by smtp.aliyun-inc.com(127.0.0.1); Wed, 25 Aug 2021 18:38:27 +0800 From: Jiapeng Chong To: corentin.chary@gmail.com Cc: hdegoede@redhat.com, mgross@linux.intel.com, jdelvare@suse.com, linux@roeck-us.net, acpi4asus-user@lists.sourceforge.net, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, Jiapeng Chong Subject: [PATCH] asus-wmi: Fix "unsigned 'retval' is never less than zero" smatch warning Date: Wed, 25 Aug 2021 18:37:02 +0800 Message-Id: <1629887822-23918-1-git-send-email-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Eliminate the follow smatch warnings: drivers/platform/x86/asus-wmi.c:478 panel_od_write() warn: unsigned 'retval' is never less than zero. drivers/platform/x86/asus-wmi.c:566 panel_od_write() warn: unsigned 'retval' is never less than zero. drivers/platform/x86/asus-wmi.c:1451 panel_od_write() warn: unsigned 'retval' is never less than zero. Reported-by: Abaci Robot Fixes: 98829e84dc67 ("asus-wmi: Add dgpu disable method") Fixes: 382b91db8044 ("asus-wmi: Add egpu enable method") Fixes: ca91ea34778f ("asus-wmi: Add panel overdrive functionality") Signed-off-by: Jiapeng Chong --- drivers/platform/x86/asus-wmi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index cc58118..22af431 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -475,7 +475,7 @@ static int dgpu_disable_write(struct asus_wmi *asus) return err; } - if (retval > 1 || retval < 0) { + if (retval > 1) { pr_warn("Failed to set dgpu disable (retval): 0x%x\n", retval); return -EIO; } @@ -563,7 +563,7 @@ static int egpu_enable_write(struct asus_wmi *asus) return err; } - if (retval > 1 || retval < 0) { + if (retval > 1) { pr_warn("Failed to set egpu disable (retval): 0x%x\n", retval); return -EIO; } @@ -1448,7 +1448,7 @@ static int panel_od_write(struct asus_wmi *asus) return err; } - if (retval > 1 || retval < 0) { + if (retval > 1) { pr_warn("Failed to set panel overdrive (retval): 0x%x\n", retval); return -EIO; } -- 1.8.3.1