From patchwork Tue Jan 24 19:14:52 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: 47843 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2332246wrn; Tue, 24 Jan 2023 11:23:34 -0800 (PST) X-Google-Smtp-Source: AMrXdXtftQH1PWg8+AmBxcg9PGbB5WHFOOm4wtxNz6atnKsanaAz8CKRPJD+GJxkWjC3cz2MHDAr X-Received: by 2002:a17:902:d651:b0:194:bdcf:1ab8 with SMTP id y17-20020a170902d65100b00194bdcf1ab8mr22936195plh.37.1674588214587; Tue, 24 Jan 2023 11:23:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674588214; cv=none; d=google.com; s=arc-20160816; b=A/rICY8hp506MMt/N/g3XwypMCvA57bEWy1yV89YpAcnzwTivEFQErquFOdur3Z8X7 +Xj9/NNGJtvvSs8Cv+XQdZgv3OqNm2gzRdc+Klfo70poj+NWgErlxq7MKWkl5qkXjBO3 +KH930PFo+vAG6gbfHbgEYiMrOXXn2AlV7O7Vbbbv6Mv4LfVx5yWPpM90TBKzCjFnWmF Pi8lpeIVMPBUdnNr0f/GPJxKdIaQNek0LyvZADcrU9XPOJBZpcEFlyp3Ziim8rIvG1EM zy7pT+553RJGBgg04u5KzYSHI2dm891RRvh/XCOO3r+F0gn+1GWoHRGRiiM3qXDhJzoe Sprg== 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=KgGzvqK1T70L5KxMqFq6gfzjgr7XokXMLyiesF87F/Y=; b=gls3LOxp5DUQwRQqrKuf3RXFWeT0u07Jm7+U0vX7vxl8aEm8wGWcIVk1MK8amV+jY2 jKBAlRCqTVgx8/VJVRkMgkZsVJR/EV7UYFzikPCuaSYtpXmbDr9Rva/+2NzGuWCVVCC2 pPD4w8+3qHDjPCVx0Bo1YoiEuKUCcC5uw9MBYxcB2mgsEGlFaAcok76g305fR9bPEFNE 61Y36il91cD0czyeMAqB4gR+MXvp/Era3erEluTWzIL7CZGdgmsndd7U8tQUeuvRahs9 jd7lW6uy6dBzLgT24XJF5/TCLclUnAVpz1c/grHdZ9WhoAv63JIA/kbnf6ZjsrFmxo0l 7nxA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r3-20020a170902be0300b00186aad06b52si3146100pls.290.2023.01.24.11.23.22; Tue, 24 Jan 2023 11:23:34 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234605AbjAXTTZ (ORCPT + 99 others); Tue, 24 Jan 2023 14:19:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234512AbjAXTTQ (ORCPT ); Tue, 24 Jan 2023 14:19:16 -0500 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C412F4ED00; Tue, 24 Jan 2023 11:19:13 -0800 (PST) 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.1.0) id 899c60219e9c5128; Tue, 24 Jan 2023 20:19:12 +0100 Received: from kreacher.localnet (unknown [213.134.189.30]) (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 7D39D7A644A; Tue, 24 Jan 2023 20:19:11 +0100 (CET) From: "Rafael J. Wysocki" To: Linux PM Cc: LKML , Linux ACPI , Zhang Rui , Srinivas Pandruvada , Daniel Lezcano Subject: [PATCH v1 2/6] thermal: intel: int340x: Rename variable in int340x_thermal_zone_add() Date: Tue, 24 Jan 2023 20:14:52 +0100 Message-ID: <2152349.irdbgypaU6@kreacher> In-Reply-To: <12159228.O9o76ZdvQC@kreacher> References: <12159228.O9o76ZdvQC@kreacher> MIME-Version: 1.0 X-CLIENT-IP: 213.134.189.30 X-CLIENT-HOSTNAME: 213.134.189.30 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedruddvtddguddvudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefufffkjghfggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpedvffeuiedtgfdvtddugeeujedtffetteegfeekffdvfedttddtuefhgeefvdejhfenucfkphepvddufedrudefgedrudekledrfedtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvddufedrudefgedrudekledrfedtpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhnsggprhgtphhtthhopeeipdhrtghpthhtoheplhhinhhugidqphhmsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqrggtphhisehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheprhhuihdriihhrghnghesihhnthgvlhdrtghomhdprhgtphhtthho pehsrhhinhhivhgrshdrphgrnhgurhhuvhgruggrsehlihhnuhigrdhinhhtvghlrdgtohhmpdhrtghpthhtohepuggrnhhivghlrdhlvgiitggrnhhosehlihhnrghrohdrohhrgh X-DCC--Metrics: v370.home.net.pl 1024; Body=6 Fuz1=6 Fuz2=6 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755933011634730808?= X-GMAIL-MSGID: =?utf-8?q?1755933011634730808?= From: Rafael J. Wysocki Rename local variable int34x_thermal_zone in int340x_thermal_zone_add() to int34x_zone which allows a number of code lines to become shorter and easier to read and adjust some white space for consistency. No intentional functional impact. Signed-off-by: Rafael J. Wysocki --- drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c | 69 +++++------ 1 file changed, 34 insertions(+), 35 deletions(-) Index: linux-pm/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c =================================================================== --- linux-pm.orig/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c +++ linux-pm/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c @@ -118,82 +118,81 @@ static struct thermal_zone_params int340 struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *adev, int (*get_temp) (struct thermal_zone_device *, int *)) { - struct int34x_thermal_zone *int34x_thermal_zone; + struct int34x_thermal_zone *int34x_zone; unsigned long long trip_cnt = 0; int trip_mask = 0; acpi_status status; int i, ret; - int34x_thermal_zone = kzalloc(sizeof(*int34x_thermal_zone), GFP_KERNEL); - if (!int34x_thermal_zone) + int34x_zone = kzalloc(sizeof(*int34x_zone), GFP_KERNEL); + if (!int34x_zone) return ERR_PTR(-ENOMEM); - int34x_thermal_zone->adev = adev; + int34x_zone->adev = adev; - int34x_thermal_zone->ops = kmemdup(&int340x_thermal_zone_ops, - sizeof(int340x_thermal_zone_ops), GFP_KERNEL); - if (!int34x_thermal_zone->ops) { + int34x_zone->ops = kmemdup(&int340x_thermal_zone_ops, + sizeof(int340x_thermal_zone_ops), GFP_KERNEL); + if (!int34x_zone->ops) { ret = -ENOMEM; goto err_ops_alloc; } if (get_temp) - int34x_thermal_zone->ops->get_temp = get_temp; + int34x_zone->ops->get_temp = get_temp; status = acpi_evaluate_integer(adev->handle, "PATC", NULL, &trip_cnt); if (ACPI_SUCCESS(status)) { - int34x_thermal_zone->aux_trip_nr = trip_cnt; + int34x_zone->aux_trip_nr = trip_cnt; trip_mask = BIT(trip_cnt) - 1; } trip_cnt += INT340X_THERMAL_MAX_TRIP_COUNT; - int34x_thermal_zone->trips = kzalloc(sizeof(*int34x_thermal_zone->trips) * trip_cnt, - GFP_KERNEL); - if (!int34x_thermal_zone->trips) { + int34x_zone->trips = kzalloc(sizeof(*int34x_zone->trips) * trip_cnt, GFP_KERNEL); + if (!int34x_zone->trips) { ret = -ENOMEM; goto err_trips_alloc; } - trip_cnt = int340x_thermal_read_trips(int34x_thermal_zone); + trip_cnt = int340x_thermal_read_trips(int34x_zone); for (i = 0; i < trip_cnt; ++i) - int340x_thermal_get_global_hyst(adev, &int34x_thermal_zone->trips[i].hysteresis); + int340x_thermal_get_global_hyst(adev, &int34x_zone->trips[i].hysteresis); - for (i = 0; i < int34x_thermal_zone->aux_trip_nr; i++) { - int34x_thermal_zone->trips[i].type = THERMAL_TRIP_PASSIVE; - int34x_thermal_zone->trips[i].temperature = THERMAL_TEMP_INVALID; + for (i = 0; i < int34x_zone->aux_trip_nr; i++) { + int34x_zone->trips[i].type = THERMAL_TRIP_PASSIVE; + int34x_zone->trips[i].temperature = THERMAL_TEMP_INVALID; } - int34x_thermal_zone->lpat_table = acpi_lpat_get_conversion_table(adev->handle); + int34x_zone->lpat_table = acpi_lpat_get_conversion_table(adev->handle); - int34x_thermal_zone->zone = thermal_zone_device_register_with_trips( - acpi_device_bid(adev), - int34x_thermal_zone->trips, - trip_cnt, - trip_mask, int34x_thermal_zone, - int34x_thermal_zone->ops, - &int340x_thermal_params, - 0, 0); - if (IS_ERR(int34x_thermal_zone->zone)) { - ret = PTR_ERR(int34x_thermal_zone->zone); + int34x_zone->zone = thermal_zone_device_register_with_trips( + acpi_device_bid(adev), + int34x_zone->trips, + trip_cnt, + trip_mask, int34x_zone, + int34x_zone->ops, + &int340x_thermal_params, + 0, 0); + if (IS_ERR(int34x_zone->zone)) { + ret = PTR_ERR(int34x_zone->zone); goto err_thermal_zone; } - ret = thermal_zone_device_enable(int34x_thermal_zone->zone); + ret = thermal_zone_device_enable(int34x_zone->zone); if (ret) goto err_enable; - return int34x_thermal_zone; + return int34x_zone; err_enable: - thermal_zone_device_unregister(int34x_thermal_zone->zone); + thermal_zone_device_unregister(int34x_zone->zone); err_thermal_zone: - kfree(int34x_thermal_zone->trips); - acpi_lpat_free_conversion_table(int34x_thermal_zone->lpat_table); + kfree(int34x_zone->trips); + acpi_lpat_free_conversion_table(int34x_zone->lpat_table); err_trips_alloc: - kfree(int34x_thermal_zone->ops); + kfree(int34x_zone->ops); err_ops_alloc: - kfree(int34x_thermal_zone); + kfree(int34x_zone); return ERR_PTR(ret); } EXPORT_SYMBOL_GPL(int340x_thermal_zone_add);