From patchwork Thu Sep 21 17:58:32 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: 142957 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp5176267vqi; Thu, 21 Sep 2023 15:23:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGJOhlMd+nuXX9M8wRYcZfT2r68TfjOhZspT9nHm8JXgCaYSh00ouDz+58tGrIMdhfiA7T6 X-Received: by 2002:a05:6e02:1190:b0:345:79eb:e001 with SMTP id y16-20020a056e02119000b0034579ebe001mr6619068ili.19.1695335012113; Thu, 21 Sep 2023 15:23:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695335012; cv=none; d=google.com; s=arc-20160816; b=FA3JH3Aj5jdKswy1KIsni9dd2nqgcIrKTqG2uu7sEvkt3yiYFB7sEnMgMP0NajqTxM o/S3nETfiJarZ00APC2Zuhwbx2kvQ0/mtS8m2Bf2SSvxEe4EjirVpJBtjRc1Yo0dh/0a EHSJlvfTd29xHHzv05OeveIKLfxQkAlc+UKe+JF0XEKY0qjhk7mNsxdAE0lWlVZb+CNZ 8MBW2KyvM4IjCQrjOkWBxxMCQONzXgpglEwD8HL5IIFO2XBDiIXxWhtJ8P7+U3E6mdnS u0TbEQ6sXJbq7mPEtryqsen2TmuFt1i4NZidAPnfsGChhQitt0a2LI30QEhcKWVVXLGf zaLQ== 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=wQLsZzP7HfqaU9mX9RXdT30rY+Ags3V1ra5Ey9pbd6s=; fh=M3Xj0cy8L+JeZSSd0Q6EHM9/xVzlLsbYrLkDMv02gfM=; b=qlpgd8u62WHMCU4Gs1N1CHPgmF6FuIVNNVdKzD+ga3HTOErAcBU7Qlh7sFNPQIkXqO qP9XPrUeyqYW8Vru/V9xe812h/BLhOHS15+TnnhwS8vDxm+zyy74s7E4U4fF22Z4ZDaz RIsS8O7lHeXn6aJqf9hnxNCGmXGtbu/1TJYmR1htgqxyIWyh76xWh596RaatI2RWGfbp Cl0PBj78XB/MS7QDOwUk3xE/n3Mv8hiaJgQO3oCYFFO6CVPGU5HYdv7L1FabFowR9xuw I5frR6DRcHSpD9OATfXijVTl4rYy0m3rUJWK06E37uuUJlpQHSDYe/Fj55aJPvpvg+eR jd3g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id o15-20020a656a4f000000b00565eedb1cf8si2647092pgu.825.2023.09.21.15.23.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 15:23:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 9041A8198C66; Thu, 21 Sep 2023 15:11:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232500AbjIUWLn (ORCPT + 29 others); Thu, 21 Sep 2023 18:11:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232056AbjIUWLZ (ORCPT ); Thu, 21 Sep 2023 18:11:25 -0400 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A8A5AF6B1; Thu, 21 Sep 2023 11:07:26 -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 f5571a811c8c5fc5; Thu, 21 Sep 2023 20:07:25 +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 85623664EBE; Thu, 21 Sep 2023 20:07:24 +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 09/13] thermal: core: Rename trip point index function arguments in governors Date: Thu, 21 Sep 2023 19:58:32 +0200 Message-ID: <3719288.MHq7AAxBmi@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 agentk.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 (agentk.vger.email [0.0.0.0]); Thu, 21 Sep 2023 15:11:53 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777687605847962742 X-GMAIL-MSGID: 1777687605847962742 From: Rafael J. Wysocki Rename function argumets used for passing trip point indices in thermal governors and in the .throttle() callback to "trip_index" to avoid confusion with trip pointer names. No intentional functional impact. Signed-off-by: Rafael J. Wysocki --- drivers/thermal/gov_bang_bang.c | 4 ++-- drivers/thermal/gov_step_wise.c | 16 ++++++++-------- drivers/thermal/gov_user_space.c | 6 +++--- include/linux/thermal.h | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) Index: linux-pm/include/linux/thermal.h =================================================================== --- linux-pm.orig/include/linux/thermal.h +++ linux-pm/include/linux/thermal.h @@ -199,7 +199,7 @@ struct thermal_governor { char name[THERMAL_NAME_LENGTH]; int (*bind_to_tz)(struct thermal_zone_device *tz); void (*unbind_from_tz)(struct thermal_zone_device *tz); - int (*throttle)(struct thermal_zone_device *tz, int trip); + int (*throttle)(struct thermal_zone_device *tz, int trip_index); struct list_head governor_list; }; Index: linux-pm/drivers/thermal/gov_user_space.c =================================================================== --- linux-pm.orig/drivers/thermal/gov_user_space.c +++ linux-pm/drivers/thermal/gov_user_space.c @@ -25,11 +25,11 @@ static int user_space_bind(struct therma /** * notify_user_space - Notifies user space about thermal events * @tz: thermal_zone_device - * @trip: trip point index + * @trip_index: trip point index * * This function notifies the user space through UEvents. */ -static int notify_user_space(struct thermal_zone_device *tz, int trip) +static int notify_user_space(struct thermal_zone_device *tz, int trip_index) { char *thermal_prop[5]; int i; @@ -38,7 +38,7 @@ static int notify_user_space(struct ther thermal_prop[0] = kasprintf(GFP_KERNEL, "NAME=%s", tz->type); thermal_prop[1] = kasprintf(GFP_KERNEL, "TEMP=%d", tz->temperature); - thermal_prop[2] = kasprintf(GFP_KERNEL, "TRIP=%d", trip); + thermal_prop[2] = kasprintf(GFP_KERNEL, "TRIP=%d", trip_index); thermal_prop[3] = kasprintf(GFP_KERNEL, "EVENT=%d", tz->notify_event); thermal_prop[4] = NULL; kobject_uevent_env(&tz->device.kobj, KOBJ_CHANGE, thermal_prop); Index: linux-pm/drivers/thermal/gov_bang_bang.c =================================================================== --- linux-pm.orig/drivers/thermal/gov_bang_bang.c +++ linux-pm/drivers/thermal/gov_bang_bang.c @@ -89,14 +89,14 @@ static int thermal_zone_trip_update(stru * (trip_temp - hyst) so that the fan gets turned off again. * */ -static int bang_bang_control(struct thermal_zone_device *tz, int trip) +static int bang_bang_control(struct thermal_zone_device *tz, int trip_index) { struct thermal_instance *instance; int ret; lockdep_assert_held(&tz->lock); - ret = thermal_zone_trip_update(tz, trip); + ret = thermal_zone_trip_update(tz, trip_index); if (ret) return ret; Index: linux-pm/drivers/thermal/gov_step_wise.c =================================================================== --- linux-pm.orig/drivers/thermal/gov_step_wise.c +++ linux-pm/drivers/thermal/gov_step_wise.c @@ -68,23 +68,23 @@ static unsigned long get_target_state(st return next_target; } -static void thermal_zone_trip_update(struct thermal_zone_device *tz, int trip_id) +static void thermal_zone_trip_update(struct thermal_zone_device *tz, int trip_index) { - const struct thermal_trip *trip = &tz->trips[trip_id]; + const struct thermal_trip *trip = &tz->trips[trip_index]; enum thermal_trend trend; struct thermal_instance *instance; bool throttle = false; int old_target; - trend = get_tz_trend(tz, trip_id); + trend = get_tz_trend(tz, trip_index); if (tz->temperature >= trip->temperature) { throttle = true; - trace_thermal_zone_trip(tz, trip_id, trip->type); + trace_thermal_zone_trip(tz, trip_index, trip->type); } dev_dbg(&tz->device, "Trip%d[type=%d,temp=%d]:trend=%d,throttle=%d\n", - trip_id, trip->type, trip->temperature, trend, throttle); + trip_index, trip->type, trip->temperature, trend, throttle); list_for_each_entry(instance, &tz->thermal_instances, tz_node) { if (instance->trip != trip) @@ -120,7 +120,7 @@ static void thermal_zone_trip_update(str /** * step_wise_throttle - throttles devices associated with the given zone * @tz: thermal_zone_device - * @trip: trip point index + * @trip_index: trip point index * * Throttling Logic: This uses the trend of the thermal zone to throttle. * If the thermal zone is 'heating up' this throttles all the cooling @@ -128,13 +128,13 @@ static void thermal_zone_trip_update(str * step. If the zone is 'cooling down' it brings back the performance of * the devices by one step. */ -static int step_wise_throttle(struct thermal_zone_device *tz, int trip) +static int step_wise_throttle(struct thermal_zone_device *tz, int trip_index) { struct thermal_instance *instance; lockdep_assert_held(&tz->lock); - thermal_zone_trip_update(tz, trip); + thermal_zone_trip_update(tz, trip_index); list_for_each_entry(instance, &tz->thermal_instances, tz_node) thermal_cdev_update(instance->cdev);