From patchwork Wed May 31 02:02:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Li X-Patchwork-Id: 101187 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2595417vqr; Tue, 30 May 2023 19:35:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ42+RO7ZOSO8uXE73Fbio87feS+6sY3SDn5lIxiETBMdGjHjuW9cpyeSIIQvCeNHQ2JJUp7 X-Received: by 2002:a05:6830:1d47:b0:6b0:981f:6b82 with SMTP id p7-20020a0568301d4700b006b0981f6b82mr726565oth.34.1685500546085; Tue, 30 May 2023 19:35:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685500546; cv=none; d=google.com; s=arc-20160816; b=ucuSsi6Sh6lYCwzQxR2NnnH/H/GUwlz5789yYC17C8ZuV9IkLUI1B6wE/XmnDsnwWo 5gl5BrXCBupiIm9mvioc0YzmiBgzzyo5tqZqWv5YT2Lvsn0WUop6bcU5cOMPNvHXE5hS hOKxTtV5SnH5+D7ZBSQTmvzQQvqEdiJeKzNbOGaMBP/SSIYMK9MMnr2QSdTbWMJFWWBf Qp6IS/HhBtpj2sdWBBAXbJc4j72yGCj+6aGzk0Gxh0DdlbAlI0TUEQCJvzDD9Ik9fr6W bIZzxJYH9NthJz1Y2+skCl7HRvUID+PuuCxoL69+aqElfoZM2ax+Q9y7gw+HDtlMSNND vPPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=5dIMSxT5dnXEnC+hwg+bswaYrkmq5LLbNGr9eWMYYMk=; b=GVZ9X0YeYdStMABWC33i+EgUM/+kbfeRvvs8mlDzTGuFe7AMOt/eBGEkDfOu+1JJg/ EkWJdfdLb21u2ek1kN8y/QAaeZ3G6eSHQX342BBAJnAV9m4OwRvW9Q5euMolGktL1CjQ hhLVm6RZ9i2UyHWNLRXS4lXcbYDIEWJdldpGcUIiJgE7H4qxqf4VmpFlN0Rojjhuivpu MrtqoTxqHN5MJr06mbxJ6wCMQXNXbhjqlAxDHwbxR2XyBv73aErSIZfxWVXZxzCfPPG5 TrIR7XhW9pyAkn46rQDATytOa8+hpI1fXA//H4EZS8ivDVV4ZrwgXlWVmx+dSKaDolwH YwKg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 123-20020a621981000000b006434bb21d3asi503560pfz.299.2023.05.30.19.35.32; Tue, 30 May 2023 19:35:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S233702AbjEaCCr (ORCPT + 99 others); Tue, 30 May 2023 22:02:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231219AbjEaCCp (ORCPT ); Tue, 30 May 2023 22:02:45 -0400 Received: from out30-118.freemail.mail.aliyun.com (out30-118.freemail.mail.aliyun.com [115.124.30.118]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB7CEEC; Tue, 30 May 2023 19:02:43 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R481e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046059;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0VjvXqog_1685498559; Received: from localhost(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0VjvXqog_1685498559) by smtp.aliyun-inc.com; Wed, 31 May 2023 10:02:40 +0800 From: Yang Li To: pavel@ucw.cz Cc: lee@kernel.org, linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, Yang Li , Abaci Robot Subject: [PATCH -next] leds: cht-wcove: Fix an unsigned comparison which can never be negative Date: Wed, 31 May 2023 10:02:38 +0800 Message-Id: <20230531020238.102684-1-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767375420047670818?= X-GMAIL-MSGID: =?utf-8?q?1767375420047670818?= The return value from the call to cht_wc_leds_find_freq() is int. However, the return value is being assigned to an unsigned int variable 'ctrl', so making it an int. Eliminate the following warning: drivers/leds/leds-cht-wcove.c:236 cht_wc_leds_set_effect() warn: unsigned 'ctrl' is never less than zero. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5341 Signed-off-by: Yang Li --- drivers/leds/leds-cht-wcove.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/leds/leds-cht-wcove.c b/drivers/leds/leds-cht-wcove.c index 0cfebee98910..10afd03164b4 100644 --- a/drivers/leds/leds-cht-wcove.c +++ b/drivers/leds/leds-cht-wcove.c @@ -223,8 +223,7 @@ static int cht_wc_leds_set_effect(struct led_classdev *cdev, u8 effect) { struct cht_wc_led *led = container_of(cdev, struct cht_wc_led, cdev); - unsigned int ctrl; - int ret; + int ctrl, ret; mutex_lock(&led->mutex);