From patchwork Thu Sep 21 18:06:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 142834 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp5059188vqi; Thu, 21 Sep 2023 11:38:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEv7Im8SxZr753VTDj/A8fc7Jle4xiuu+6FzBwE4AugqLjS7uTLh33hLxVQxxFs0Dh4h4/g X-Received: by 2002:a05:6300:808b:b0:14c:4deb:7189 with SMTP id ap11-20020a056300808b00b0014c4deb7189mr5555218pzc.26.1695321538699; Thu, 21 Sep 2023 11:38:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695321538; cv=none; d=google.com; s=arc-20160816; b=YLPNfgyAMWkaY96XmYODjscNjUEIL35Sy3Ggaz/EXJdz286spnmteSQBF8yYkWkQvQ t0y42bjwHxF/TkZH5x5q5xxwlth3+6PKNgCKM7EIixU/6Yj6+q4dCyxz5kSCEdNXmR8T iTUYc9S8ZczmP7njLVSxTO9MzHlzDm5fvovnwBb1+Pl44W7UIMSIKUuNIWoZf9R5uuEj ft+oqkSqbI9AKpL76M+qtYbytwE60WGrU5JbanZi9WS6R6uD6V5LNgSJznluUIgvz4Zt bhhFnfXQxAQFcEmFNuXza8rNHYNlTIz5pLZ59WcM7E9XUKadaVLSysQ6XEndlji1tegW DJAA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=YxxbWkUeeE9us7vZDXuPmdRNs0DyT1A2hQfeE3JZf+g=; fh=M3Xj0cy8L+JeZSSd0Q6EHM9/xVzlLsbYrLkDMv02gfM=; b=p4a+K+vYax7s5tHvVN9LxG6yqW15mi+CWgqCLF3wRi8+STTTA2/1YrH70aIAM16IV5 U/e/tfe1NUTn7EeJVyGevhfj2ArzgXRVc7Za66Zfds0zpyZgul7PnqGdG9kPQMvwIqul fXa9W1AaZ17g/tQ5IiyRuux2s6vJ4Y7u8r5xYDausqP39dPcCaYtYtzL1iJBlPsOF6a5 8WXWWSbpzGN4eAZ2+mqWRUMwShN6bxnVTXHYQQHpL+8vfMHia9Oi7ENfdX1+LORWyAwR 1IeOUDpDsTo9f8uZEqjBbdE0lOswpJEcmv2eNdFwIYEkqRoP1O9WLXNmpNm0GmKKLI8l IB9g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id by14-20020a056a00400e00b006901a8f5dadsi1947567pfb.289.2023.09.21.11.38.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 11:38:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id A335F837E999; Thu, 21 Sep 2023 11:36:55 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230173AbjIUSgx (ORCPT + 29 others); Thu, 21 Sep 2023 14:36:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229602AbjIUSg1 (ORCPT ); Thu, 21 Sep 2023 14:36:27 -0400 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17704AF69C; Thu, 21 Sep 2023 11:07:22 -0700 (PDT) Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 5.2.0) id 2fecdf3dfb7fb0c9; Thu, 21 Sep 2023 20:07:21 +0200 Received: from kreacher.localnet (unknown [195.136.19.94]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by v370.home.net.pl (Postfix) with ESMTPSA id 0973A664EBE; Thu, 21 Sep 2023 20:07:21 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux PM Cc: LKML , Linux ACPI , Srinivas Pandruvada , Zhang Rui , Daniel Lezcano , Lukasz Luba , "Rafael J. Wysocki" Subject: [PATCH v1 13/13] ACPI: thermal: Rename structure fields holding temperature in deci-Kelvin Date: Thu, 21 Sep 2023 20:06:58 +0200 Message-ID: <1968603.yKVeVyVuyW@kreacher> In-Reply-To: <1957441.PYKUYFuaPT@kreacher> References: <1957441.PYKUYFuaPT@kreacher> MIME-Version: 1.0 X-CLIENT-IP: 195.136.19.94 X-CLIENT-HOSTNAME: 195.136.19.94 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedviedrudekiedguddvtdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefufffkjghfggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpedvffeuiedtgfdvtddugeeujedtffetteegfeekffdvfedttddtuefhgeefvdejhfenucfkphepudelhedrudefiedrudelrdelgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduleehrddufeeirdduledrleegpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhnsggprhgtphhtthhopeekpdhrtghpthhtoheplhhinhhugidqphhmsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqrggtphhisehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepshhrihhnihhvrghsrdhprghnughruhhvrggurgeslhhinhhugidrihhn thgvlhdrtghomhdprhgtphhtthhopehruhhirdiihhgrnhhgsehinhhtvghlrdgtohhmpdhrtghpthhtohepuggrnhhivghlrdhlvgiitggrnhhosehlihhnrghrohdrohhrgh X-DCC--Metrics: v370.home.net.pl 1024; Body=8 Fuz1=8 Fuz2=8 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 21 Sep 2023 11:36:55 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777673478003704292 X-GMAIL-MSGID: 1777673478003704292 From: Rafael J. Wysocki Subject: [PATCH v1] Rename structure fields holding temperature values in deci-Kelvin so as to avoid temperature units confusion. No intentional functional impact. Signed-off-by: Rafael J. Wysocki Acked-by: Daniel Lezcano --- drivers/acpi/thermal.c | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) Index: linux-pm/drivers/acpi/thermal.c =================================================================== --- linux-pm.orig/drivers/acpi/thermal.c +++ linux-pm/drivers/acpi/thermal.c @@ -82,7 +82,7 @@ MODULE_PARM_DESC(psv, "Disable or overri static struct workqueue_struct *acpi_thermal_pm_queue; struct acpi_thermal_trip { - unsigned long temperature; + unsigned long temp_dk; struct acpi_handle_list devices; }; @@ -105,8 +105,8 @@ struct acpi_thermal_trips { struct acpi_thermal { struct acpi_device *device; acpi_bus_id name; - unsigned long temperature; - unsigned long last_temperature; + unsigned long temp_dk; + unsigned long last_temp_dk; unsigned long polling_frequency; volatile u8 zombie; struct acpi_thermal_trips trips; @@ -131,16 +131,16 @@ static int acpi_thermal_get_temperature( if (!tz) return -EINVAL; - tz->last_temperature = tz->temperature; + tz->last_temp_dk = tz->temp_dk; status = acpi_evaluate_integer(tz->device->handle, "_TMP", NULL, &tmp); if (ACPI_FAILURE(status)) return -ENODEV; - tz->temperature = tmp; + tz->temp_dk = tmp; acpi_handle_debug(tz->device->handle, "Temperature is %lu dK\n", - tz->temperature); + tz->temp_dk); return 0; } @@ -175,7 +175,7 @@ static int acpi_thermal_temp(struct acpi static bool acpi_thermal_trip_valid(struct acpi_thermal_trip *acpi_trip) { - return acpi_trip->temperature != THERMAL_TEMP_INVALID; + return acpi_trip->temp_dk != THERMAL_TEMP_INVALID; } static long get_passive_temp(struct acpi_thermal *tz) @@ -197,7 +197,7 @@ static void acpi_thermal_update_passive_ if (!acpi_thermal_trip_valid(acpi_trip) || psv > 0) return; - acpi_trip->temperature = get_passive_temp(tz); + acpi_trip->temp_dk = get_passive_temp(tz); if (!acpi_thermal_trip_valid(acpi_trip)) ACPI_THERMAL_TRIPS_EXCEPTION(tz, "state"); } @@ -244,7 +244,7 @@ static void acpi_thermal_update_trip_dev return; } - acpi_trip->temperature = THERMAL_TEMP_INVALID; + acpi_trip->temp_dk = THERMAL_TEMP_INVALID; ACPI_THERMAL_TRIPS_EXCEPTION(tz, "state"); } @@ -278,7 +278,7 @@ static void acpi_thermal_update_active_t if (!acpi_thermal_trip_valid(acpi_trip)) return; - acpi_trip->temperature = get_active_temp(tz, index); + acpi_trip->temp_dk = get_active_temp(tz, index); if (!acpi_thermal_trip_valid(acpi_trip)) ACPI_THERMAL_TRIPS_EXCEPTION(tz, "state"); } @@ -292,7 +292,7 @@ static int acpi_thermal_adjust_trip(stru return 0; if (acpi_thermal_trip_valid(acpi_trip)) - trip->temperature = acpi_thermal_temp(tz, acpi_trip->temperature); + trip->temperature = acpi_thermal_temp(tz, acpi_trip->temp_dk); else trip->temperature = THERMAL_TEMP_INVALID; @@ -447,11 +447,11 @@ static bool acpi_thermal_init_trip(struc if (!update_trip_devices(tz, acpi_trip, index, false)) goto fail; - acpi_trip->temperature = temp; + acpi_trip->temp_dk = temp; return true; fail: - acpi_trip->temperature = THERMAL_TEMP_INVALID; + acpi_trip->temp_dk = THERMAL_TEMP_INVALID; return false; } @@ -488,7 +488,7 @@ static int thermal_get_temp(struct therm if (result) return result; - *temp = deci_kelvin_to_millicelsius_with_offset(tz->temperature, + *temp = deci_kelvin_to_millicelsius_with_offset(tz->temp_dk, tz->kelvin_offset); return 0; } @@ -510,10 +510,10 @@ static int thermal_get_trend(struct ther switch (trip->type) { case THERMAL_TRIP_PASSIVE: - t = tz->trips.passive.tc1 * (tz->temperature - - tz->last_temperature) + - tz->trips.passive.tc2 * (tz->temperature - - acpi_trip->temperature); + t = tz->trips.passive.tc1 * (tz->temp_dk - + tz->last_temp_dk) + + tz->trips.passive.tc2 * (tz->temp_dk - + acpi_trip->temp_dk); if (t > 0) *trend = THERMAL_TREND_RAISING; else if (t < 0) @@ -524,7 +524,7 @@ static int thermal_get_trend(struct ther return 0; case THERMAL_TRIP_ACTIVE: - t = acpi_thermal_temp(tz, tz->temperature); + t = acpi_thermal_temp(tz, tz->temp_dk); if (t <= trip->temperature) break; @@ -894,7 +894,7 @@ static int acpi_thermal_add(struct acpi_ passive_delay = tz->trips.passive.tsp * 100; trip->type = THERMAL_TRIP_PASSIVE; - trip->temperature = acpi_thermal_temp(tz, acpi_trip->temperature); + trip->temperature = acpi_thermal_temp(tz, acpi_trip->temp_dk); trip->priv = acpi_trip; trip++; } @@ -906,7 +906,7 @@ static int acpi_thermal_add(struct acpi_ break; trip->type = THERMAL_TRIP_ACTIVE; - trip->temperature = acpi_thermal_temp(tz, acpi_trip->temperature); + trip->temperature = acpi_thermal_temp(tz, acpi_trip->temp_dk); trip->priv = acpi_trip; trip++; } @@ -920,7 +920,7 @@ static int acpi_thermal_add(struct acpi_ INIT_WORK(&tz->thermal_check_work, acpi_thermal_check_fn); pr_info("%s [%s] (%ld C)\n", acpi_device_name(device), - acpi_device_bid(device), deci_kelvin_to_celsius(tz->temperature)); + acpi_device_bid(device), deci_kelvin_to_celsius(tz->temp_dk)); result = acpi_dev_install_notify_handler(device, ACPI_DEVICE_NOTIFY, acpi_thermal_notify);