Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3780925rwl; Mon, 27 Mar 2023 20:31:55 -0700 (PDT) X-Google-Smtp-Source: AKy350Y5aq1lPoNlWBn5VtA1xcVzxzstf1i3xMX6Piwz5yRtT7u7PcErSddFrHx2eskxxPMfNk4k X-Received: by 2002:a17:902:dac4:b0:1a1:a9a4:ba36 with SMTP id q4-20020a170902dac400b001a1a9a4ba36mr16677462plx.41.1679974315033; Mon, 27 Mar 2023 20:31:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679974315; cv=none; d=google.com; s=arc-20160816; b=TeJEOgDzuBrvayxGBAkq8cQZnkJ9K9z3CQzLmlVbX6zMxWXSNzy7qAyY4EzlXE2aLB ANU7m1NMsJ1GsecB2bKB+hK0n2K0jKJfDZxnwxxTwAfvuodYLwOooCGaAQKh9pleDmyA C2dQAamdoHAfhXbyATmvQLC8+DyD/lxgfLTj98LSE1LgzEONSSIKz0B5GVcqIc3AEgjt Frp3PamMUned2fmPUNGX8K6K4gqYKPvujVdoOoMAGVbRN6vGmaBj0h3KTCvrjYaeL6DA ScP8pLnv6Im/lT+l5Awc1rndLncV1q3LrMpvsASznSch8DLF69M34DpdlQSeSDexqOef cCog== 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=mYvvJBL+dqPBXAcwt+89umEMOmh0SIGeNa/d+BYsv7I=; b=raXBtvr00gwquAsM3Jk7gIPFFOkZl9M3FmnbGwjLKtt2CQxFjiwZz/T1OFSy39KmcL 7qEI/IAkK0w/bHVzZ+6Mlwj9TImXNmR00x0Crms8YB1TCU5Mb5+7p2zsnAnC3rHKpzVy yF/1WXYM0AOss7zh3KHcug4XeA5Ox3JNJ1GeuoYzlmioOyTG2PnUdUnePeXydhpyPOl+ v+i43+QHnfYXrfR5Hm0pskXAFq2EOMWKsQO3Ra1NjUwVBNCrmvBEExVXoiN4ptd0YI5F W2sc6J2sZGiUwH08i7nby20ZFZpGuOISMp+iAQZXUowvStkoAJJ1QaGcZdjXbFGtv81Z J2GA== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n18-20020a63e052000000b0050317bc90a4si28185716pgj.547.2023.03.27.20.31.42; Mon, 27 Mar 2023 20:31:55 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232322AbjC1DR3 (ORCPT + 99 others); Mon, 27 Mar 2023 23:17:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229610AbjC1DR1 (ORCPT ); Mon, 27 Mar 2023 23:17:27 -0400 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65ED41A6; Mon, 27 Mar 2023 20:17:24 -0700 (PDT) X-UUID: 772770d80c7d4fd38ba61bfec402c8de-20230328 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.20,REQID:f8a37e21-fb75-4c37-b66e-8dd682e4175d,IP:10, URL:0,TC:0,Content:-5,EDM:25,RT:0,SF:1,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:31 X-CID-INFO: VERSION:1.1.20,REQID:f8a37e21-fb75-4c37-b66e-8dd682e4175d,IP:10,UR L:0,TC:0,Content:-5,EDM:25,RT:0,SF:1,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:31 X-CID-META: VersionHash:25b5999,CLOUDID:ea98ae29-564d-42d9-9875-7c868ee415ec,B ulkID:230328111721W4Q58S1F,BulkQuantity:0,Recheck:0,SF:24|17|19|43|102,TC: nil,Content:0,EDM:5,IP:-2,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI :0,OSA:0,AV:0 X-CID-BVR: 0,NGT X-UUID: 772770d80c7d4fd38ba61bfec402c8de-20230328 Received: from mail.kylinos.cn [(39.156.73.10)] by mailgw (envelope-from ) (Generic MTA) with ESMTP id 505668487; Tue, 28 Mar 2023 11:17:18 +0800 Received: from mail.kylinos.cn (localhost [127.0.0.1]) by mail.kylinos.cn (NSMail) with SMTP id 93F94E0084A1; Tue, 28 Mar 2023 11:17:18 +0800 (CST) X-ns-mid: postfix-64225C3E-350120133 Received: from localhost.localdomain (unknown [172.20.125.154]) by mail.kylinos.cn (NSMail) with ESMTPA id CCA28E0084A1; Tue, 28 Mar 2023 11:17:17 +0800 (CST) From: Jiangshan Yi To: rafael@kernel.org Cc: rui.zhang@intel.com, lenb@kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, 13667453960@163.com, Jiangshan Yi Subject: [PATCH] ACPI: thermal: replace ternary operator with min_t() Date: Tue, 28 Mar 2023 11:16:29 +0800 Message-Id: <20230328031629.202268-1-yijiangshan@kylinos.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY autolearn=unavailable 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 Fix the following coccicheck warning: drivers/acpi/thermal.c:422: WARNING opportunity for min(). min_t() macro is defined in include/linux/minmax.h. It avoids multiple evaluations of the arguments when non-constant and performs strict type-checking. Signed-off-by: Jiangshan Yi --- drivers/acpi/thermal.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 0b4b844f9d4c..179f41196a9d 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -419,10 +419,9 @@ static int acpi_thermal_trips_update(struct acpi_the= rmal *tz, int flag) * the next higher trip point */ tz->trips.active[i-1].temperature =3D - (tz->trips.active[i-2].temperature < - celsius_to_deci_kelvin(act) ? - tz->trips.active[i-2].temperature : - celsius_to_deci_kelvin(act)); + min_t(unsigned long, + tz->trips.active[i-2].temperature, + celsius_to_deci_kelvin(act)); =20 break; } else { --=20 2.25.1