Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp758223rwb; Thu, 12 Jan 2023 11:57:02 -0800 (PST) X-Google-Smtp-Source: AMrXdXsED5ZuNo89RJzUpBhmbkR5MqEuE53t/+gIGHxNvykbpRcIam2F9w72wMA2kFGMGAFdl5aD X-Received: by 2002:a17:90b:3d8f:b0:229:1640:1879 with SMTP id pq15-20020a17090b3d8f00b0022916401879mr1360376pjb.40.1673553421881; Thu, 12 Jan 2023 11:57:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673553421; cv=none; d=google.com; s=arc-20160816; b=DK+jfWHnsxFbrUHwoQk/wNI1JF4LhVJrdPqQCa02BEQN6Fo+Z4d84Zvqti+0WoESjM mkLyDgz7UlgRJQW+0czCXSvyhPKCOk0fbDByGoAh+yG4/vTPTH+f1WcMgiLPGCTQJN4g SZPEGmoOaw+mLsi3yKs7VifsG2vOrnJnWiiieNRJ+aJu1pAFg99hha9BgfrBr9N3HK3M jL4ewg1is4Cw+zpikM8zZoZZG3jtSgIwnqCNVtTXLEdBS8QZopf5o32wpILfPjYFom9n pxP1YhI4NBrSWlr1ErC+A76OCnkbEuOS/HFqaKd9VvtDCzngRwO1vqdvFw0oph3zvfL3 A9gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=nKrf1dgum1SXnE9nilvyIY+Ubkbdg8+lqnAjJi8wIj8=; b=cARAj9vljqUuVtTlApd4ECvf3I4SZ+1V0WuMGSWPjtR/kEpRnoA39Rnt3/hzvky5Ah G0QnmbAwh8lfhjd8eSzKvCvt9otSmLH6yr/kjO2SB/UPmpL2fu0378NXBpanvK3SuEWa YtpWpw6KqTrt2iE6Up8uen/wXx/1RKSE9MtBCG721rqiIYda1mE2tp3aOIQiGSCohN1f h2NsmZuoq8eYT2QALCb0SF4z+WMzxiIE+vzaveCvu3fkNfAfpnw/yBRZQSbSi/qx5ekp cXkHvludqtIPaPafV7GQfI0f7YSxK/FoN7+yi2uYY0o/cc1wjRnd8jwOtK+3bEn9qix8 mrIQ== 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id li16-20020a17090b48d000b002199a16366csi17600652pjb.173.2023.01.12.11.56.55; Thu, 12 Jan 2023 11:57:01 -0800 (PST) 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233143AbjALT30 (ORCPT + 50 others); Thu, 12 Jan 2023 14:29:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240642AbjALT2q (ORCPT ); Thu, 12 Jan 2023 14:28:46 -0500 Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13D9965F3; Thu, 12 Jan 2023 11:23:28 -0800 (PST) Received: by mail-ej1-f51.google.com with SMTP id u9so47258319ejo.0; Thu, 12 Jan 2023 11:23:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=nKrf1dgum1SXnE9nilvyIY+Ubkbdg8+lqnAjJi8wIj8=; b=Cr9F3G70miWMcevRLId8ATPP34V50hLiZl5wswvvcJ91IWbpOO6z7xdUvwXiNsNHNi fv44BwcBCGrD20Co9ZqayQr9yaBXf5kg93fzSXrqcVG/eI51B2EAsMF/Fi6lYS/bkqMa JHpD59nOlakWkjLh1BraY0ZgU7UNVa/qckqcvg5JuJ6l0qeNP+YUhHKp5f7eSgZDPdpG 5kGdTsNEJtgfHJNz0p4dUfuUa35QF62boU97UWsdDntxrNLMNCuF8JXhxjt4se7jmGdU 4JOmuLMBrmnKZDQQc6RPrC1zQ+PKrgpE/f+MnC/1UyyT9GblD/JGAQjUkHZ1usIqCeY1 /tIg== X-Gm-Message-State: AFqh2kprK2CqpXQaEDZK5mowC3l8oJAIAJsPYyAqcLOMmkDmsoF+Bxui b8xHGhDw+nasVAoMGceUnVB6/dFoWbZ2ylaoqts= X-Received: by 2002:a17:907:8d0e:b0:7b2:7b45:2cd2 with SMTP id tc14-20020a1709078d0e00b007b27b452cd2mr6894663ejc.615.1673551406640; Thu, 12 Jan 2023 11:23:26 -0800 (PST) MIME-Version: 1.0 References: <20230106005951.100479-1-yang.lee@linux.alibaba.com> <057bd9fa05f1bfdf10858f23506856f6376c9f8f.camel@intel.com> In-Reply-To: <057bd9fa05f1bfdf10858f23506856f6376c9f8f.camel@intel.com> From: "Rafael J. Wysocki" Date: Thu, 12 Jan 2023 20:23:15 +0100 Message-ID: Subject: Re: [PATCH -next] thermal: Fix unsigned comparison with less than zero To: "Zhang, Rui" , "yang.lee@linux.alibaba.com" Cc: "rafael@kernel.org" , "linux-pm@vger.kernel.org" , "daniel.lezcano@linaro.org" , "linux-kernel@vger.kernel.org" , "amitk@kernel.org" , "abaci@linux.alibaba.com" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no 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 On Fri, Jan 6, 2023 at 8:03 AM Zhang, Rui wrote: > > On Fri, 2023-01-06 at 08:59 +0800, Yang Li wrote: > > The return value from the call to intel_tcc_get_tjmax() is int, which > > can > > be a negative error code. However, the return value is being assigned > > to > > an u32 variable 'tj_max', so making 'tj_max' an int. > > > > Eliminate the following warning: > > ./drivers/thermal/intel/intel_soc_dts_iosf.c:394:5-11: WARNING: > > Unsigned expression compared with zero: tj_max < 0 > > > > Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3637 > > Reported-by: Abaci Robot > > Signed-off-by: Yang Li > > Thanks for catching this issue. > > Acked-by: Zhang Rui Applied, thanks! > > --- > > drivers/thermal/intel/intel_soc_dts_iosf.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/thermal/intel/intel_soc_dts_iosf.c > > b/drivers/thermal/intel/intel_soc_dts_iosf.c > > index 2138693d8afd..8c26f7b2316b 100644 > > --- a/drivers/thermal/intel/intel_soc_dts_iosf.c > > +++ b/drivers/thermal/intel/intel_soc_dts_iosf.c > > @@ -380,7 +380,7 @@ struct intel_soc_dts_sensors > > *intel_soc_dts_iosf_init( > > { > > struct intel_soc_dts_sensors *sensors; > > bool notification; > > - u32 tj_max; > > + int tj_max; > > int ret; > > int i; > >