From patchwork Mon Jan 30 18: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: 50437 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2349472wrn; Mon, 30 Jan 2023 11:11:21 -0800 (PST) X-Google-Smtp-Source: AK7set84uU9RgfuQ7YooEXzDdgEJtvy79vcincyQivysYKKBWcIa3VOiTDRatF16rUtMyiv06e6E X-Received: by 2002:a05:6402:5253:b0:4a2:358e:e734 with SMTP id t19-20020a056402525300b004a2358ee734mr9518625edd.7.1675105880820; Mon, 30 Jan 2023 11:11:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675105880; cv=none; d=google.com; s=arc-20160816; b=AJWWzKEijoPBEGcP0tjEWDodP6BN7cTEf5iy1/Of9UokooBU2id0H5J9w2pm0GpDAo 3YT9VRNRQw2LA4ALEqimeN7Bp89mSJILOwpnADeDxbutxCYVyDsNa96OjiKzImb5s080 RKow+8UJM7Erfllguy2H7tSM6lJh3Jhit8Ks+c77qi7jBRR/bF4T+Fc9z9l003sz89QJ TZ8WVF4CTSIcJZXo7f3w35b5LJj+e6tih+fF7OZ6AYcJuxkhOAech7XCsanxKr4AYq6I eLuWV6skcczo/TtSj7vC0xdh4uh8uoX65zHyquev7C30CR21/L1jJM1RKsCM4j6F59+6 rEXg== 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=dHPnRjHCg/x2QzFV7dRj2+//WEd9Oke3eyv2+VlblK8=; b=zXciRNjXYoOOsilBDDNDESmbDl4R/IgiLpq7AA9uIzDcFvzO1pg/8hMx9F+tFyK+bZ 4TT8HvXJrEB6XwwBaVR6eWTqST2kNY4jGCjeIbkV+Y5399EqjwGZlsjatFoyo9gc4Uat lD4x6k0tBVwswrrbdn9LRbNPhGPlVL1QcRpE5mOfjldz3bmwaFerURai3QhWZCeaM4RS 62uJbOLi0FoKWhMDqCYf0aiMYSaPjD/wEKRIEUseNpybbb95f54TGu7NOPPnw9/wJUbT X0veNHCjJs/tGlQClOXBdh9Kq8n0UsXFEFdeIse5UIefH1OEj5p8ifNnWgPxepfgk8HZ CUDQ== 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 y14-20020a17090668ce00b0084d1a0d90cdsi15586956ejr.674.2023.01.30.11.10.56; Mon, 30 Jan 2023 11:11:20 -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 S238334AbjA3TID (ORCPT + 99 others); Mon, 30 Jan 2023 14:08:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235858AbjA3TH5 (ORCPT ); Mon, 30 Jan 2023 14:07:57 -0500 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C8FB3A87D; Mon, 30 Jan 2023 11:07:39 -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 08df841c7d46ca66; Mon, 30 Jan 2023 20:07:37 +0100 Received: from kreacher.localnet (unknown [213.134.169.112]) (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 B6C6D2528287; Mon, 30 Jan 2023 20:07:36 +0100 (CET) From: "Rafael J. Wysocki" To: Linux PM Cc: Zhang Rui , Srinivas Pandruvada , Linux ACPI , LKML , David Box Subject: [PATCH v1 1/8] thermal: intel: intel_pch: Make pch_wpt_add_acpi_psv_trip() return int Date: Mon, 30 Jan 2023 19:58:32 +0100 Message-ID: <1941501.usQuhbGJ8B@kreacher> In-Reply-To: <1751684.VLH7GnMWUR@kreacher> References: <1751684.VLH7GnMWUR@kreacher> MIME-Version: 1.0 X-CLIENT-IP: 213.134.169.112 X-CLIENT-HOSTNAME: 213.134.169.112 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedrudefvddguddvfecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefufffkjghfggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpedvffeuiedtgfdvtddugeeujedtffetteegfeekffdvfedttddtuefhgeefvdejhfenucfkphepvddufedrudefgedrudeiledrudduvdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvudefrddufeegrdduieelrdduuddvpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhnsggprhgtphhtthhopeeipdhrtghpthhtoheplhhinhhugidqphhmsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheprhhuihdriihhrghnghesihhnthgvlhdrtghomhdprhgtphhtthhopehsrhhinhhivhgrshdrphgrnhgurhhuvhgruggrsehlihhnuhigrdhinhhtvghlrdgtohhmpdhrtghpthhtoheplhhinhhugidqrggtphhisehvghgvrhdrkhgvrhhnvghlrdho rhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepuggrvhhiugdrvgdrsghogieslhhinhhugidrihhnthgvlhdrtghomh 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?1756475824277385817?= X-GMAIL-MSGID: =?utf-8?q?1756475824277385817?= From: Rafael J. Wysocki Modify pch_wpt_add_acpi_psv_trip() to return an int value instead of using a return pointer for that. While at it, drop an excessive empty code line. Signed-off-by: Rafael J. Wysocki Acked-by: Daniel Lezcano --- drivers/thermal/intel/intel_pch_thermal.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) Index: linux-pm/drivers/thermal/intel/intel_pch_thermal.c =================================================================== --- linux-pm.orig/drivers/thermal/intel/intel_pch_thermal.c +++ linux-pm/drivers/thermal/intel/intel_pch_thermal.c @@ -90,34 +90,31 @@ struct pch_thermal_device { }; #ifdef CONFIG_ACPI - /* * On some platforms, there is a companion ACPI device, which adds * passive trip temperature using _PSV method. There is no specific * passive temperature setting in MMIO interface of this PCI device. */ -static void pch_wpt_add_acpi_psv_trip(struct pch_thermal_device *ptd, - int *nr_trips) +static int pch_wpt_add_acpi_psv_trip(struct pch_thermal_device *ptd, int trip) { struct acpi_device *adev; int temp; adev = ACPI_COMPANION(&ptd->pdev->dev); if (!adev) - return; + return 0; if (thermal_acpi_passive_trip_temp(adev, &temp) || temp <= 0) - return; + return 0; - ptd->trips[*nr_trips].type = THERMAL_TRIP_PASSIVE; - ptd->trips[*nr_trips].temperature = temp; - ++(*nr_trips); + ptd->trips[trip].type = THERMAL_TRIP_PASSIVE; + ptd->trips[trip].temperature = temp; + return 1; } #else -static void pch_wpt_add_acpi_psv_trip(struct pch_thermal_device *ptd, - int *nr_trips) +static int pch_wpt_add_acpi_psv_trip(struct pch_thermal_device *ptd, int trip) { - + return 0; } #endif @@ -167,7 +164,7 @@ read_trips: ++(*nr_trips); } - pch_wpt_add_acpi_psv_trip(ptd, nr_trips); + *nr_trips += pch_wpt_add_acpi_psv_trip(ptd, *nr_trips); return 0; }