Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1767886rwb; Wed, 26 Jul 2023 19:02:39 -0700 (PDT) X-Google-Smtp-Source: APBJJlHSNH/vCHVKxNA3WHeXG6kIsU+udoWrPiSIT5HipxrfAexlgphc3hoa589qO7EegRp09twt X-Received: by 2002:a05:6a20:6a1a:b0:12d:e596:df21 with SMTP id p26-20020a056a206a1a00b0012de596df21mr3608896pzk.7.1690423358878; Wed, 26 Jul 2023 19:02:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690423358; cv=none; d=google.com; s=arc-20160816; b=CrQPuxitiHgcRmicSDzNSxkiRTojFKUISpd4l+XTD+vOz+oZwKEDRCbmCiKi8KHcVm fSWFfm/gvgS6xosOkjzX5HO2+yHVaUXsoTX1Cr1zA97GZw5xCoUO/PPBSF27s1qXpLN8 tDxgGrWvpt3kAut8PqPlkXpjGXs87orlcL6Uzt0KRzDzHQVVI1FmsVvSK3Nu264SMhCo qIj8mPXFm6JRxJAfeQAZ8l0AHkqCgCgw4cRSrgi+xSmPEc/O9N+pEoMgv7gNvM8efN2w r5vvMJn1lsnSxncm9TzeREmPNresk9z7yBBrdi3ls2HhfwCyke/C9EeT+XCV74b8dCz1 QOdg== 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=xO3lsrk9xOj65UeO4hlp506sux9iS1shXJZdA1gd0Ag=; fh=Q/CbDwZEDzXFatuXMLuqdyNUPaEg6PCc/53riuR5v9A=; b=AdYoqUscwyruzVi1XpCZveur7uTcF8WC6T+w1fJKWr0RnZCw08INWRS1ymmDyCfif8 ciu0f5MfmwD8Zgqokd9axXZxWPHUcqHZWjVHYsA25kxkhwzv2gk9JCjEC/ak37IDJf/e v5GNbNUWMg8mnwfKoBP8dVZmLozrRvUVklDjzjzER4lykw60/eDGthutLRjTyckr9a+l H2xr/vvl9Q7mzsL0uKmP3HVqoe+sIMjZTN2uPy281er6Az1bVj8nRKR0O2m0JD+fMWaV sDCF8IinVYMpGWETvKJ5zaDW5KdIC8x6Dso/PrigK5byhtpTEfamKuE+8Eyjayrr4sax 00nQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cb3-20020a056a00430300b006665df4f1f0si416386pfb.136.2023.07.26.19.02.25; Wed, 26 Jul 2023 19:02:38 -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 S230345AbjG0BnY (ORCPT + 99 others); Wed, 26 Jul 2023 21:43:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230026AbjG0BnW (ORCPT ); Wed, 26 Jul 2023 21:43:22 -0400 Received: from out30-111.freemail.mail.aliyun.com (out30-111.freemail.mail.aliyun.com [115.124.30.111]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F0AE212B; Wed, 26 Jul 2023 18:43:19 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R161e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045192;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0VoIhdCU_1690422195; Received: from localhost(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0VoIhdCU_1690422195) by smtp.aliyun-inc.com; Thu, 27 Jul 2023 09:43:16 +0800 From: Yang Li To: Shyam-sundar.S-k@amd.com Cc: hdegoede@redhat.com, markgross@kernel.org, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Yang Li , Abaci Robot Subject: [PATCH -next] platform/x86/amd/pmf: Fix unsigned comparison with less than zero Date: Thu, 27 Jul 2023 09:43:15 +0800 Message-Id: <20230727014315.51375-1-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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,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 The return value from the call to amd_pmf_get_pprof_modes() is int. However, the return value is being assigned to an unsigned char variable 'mode', so making 'mode' an int. silence the warning: ./drivers/platform/x86/amd/pmf/sps.c:183:5-9: WARNING: Unsigned expression compared with zero: mode < 0 Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5995 Signed-off-by: Yang Li --- drivers/platform/x86/amd/pmf/sps.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/platform/x86/amd/pmf/sps.c b/drivers/platform/x86/amd/pmf/sps.c index ab69d517a36a..a70e67749be3 100644 --- a/drivers/platform/x86/amd/pmf/sps.c +++ b/drivers/platform/x86/amd/pmf/sps.c @@ -176,7 +176,8 @@ int amd_pmf_get_pprof_modes(struct amd_pmf_dev *pmf) int amd_pmf_power_slider_update_event(struct amd_pmf_dev *dev) { - u8 mode, flag = 0; + u8 flag = 0; + int mode; int src; mode = amd_pmf_get_pprof_modes(dev); -- 2.20.1.7.g153144c