From patchwork Sun Jun 4 12:21:13 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: 102982 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2113351vqr; Sun, 4 Jun 2023 05:27:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Znte8I535UomazTUPSo75YCioZadDd6gJFCOH6fohbDOPnre+nR5so7vWRrNKbsc7e2lA X-Received: by 2002:a05:6a00:982:b0:658:e95b:256a with SMTP id u2-20020a056a00098200b00658e95b256amr167832pfg.1.1685881661806; Sun, 04 Jun 2023 05:27:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685881661; cv=none; d=google.com; s=arc-20160816; b=LjBu1FBF72WienVGl5KzrDeZaBajUNk/Ay7Jsxhg9v/eNX7af81YTFSEckCLWGU5ZH s3Rj4t6Meu4knA4J9rXl2yEhDe9DR8YOhpF7qzxKf2iGYSjPVxUXu8c08d4bH+uBnbiP 4gqH8xemppg9JUEkEt3kZZ+1IRDA2/viQenQDFdjjc7hkGJTm4wGe7lzZWmp4IYgo9K+ s3jqL5yi8ZmpQiyPaCMg+ESXBlANrF7ncYVCAyL3KeLP9AgD5/WhfINpbsCFSllK5emz unq3Zpgy5fiqerq8AD4eTQafWqsSBEiWqTE0XZ9ORyRn52q5mAKUJMleKibgfHsFfV98 ubDg== 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=DYQerMJgrnvRFIpfF/Pi3ZE5hJz0Ix6Lsp8Ho9lToUE=; b=YueoOatqXQb1ofy4EwbQr8OUENcGIpkEhq1zAqg/CWYut1au7Blo3izg2Wu9i0NMQL uLf67EosXipTjF2q8h6fZoNEH/BSUru2wl6kMSgnJO8rjSWSyjdiv1JlXp6pvf/V7Fg8 xMZwKphl2DgrOifjd882A3FIxIAh/hBgyXLnwQwKOsu5N+mW20FgVyfhW1HMl/mTkZ0a Xi3GhWwo1S8Ccv9Wi0aXnjFFFsa1Bk+a5fiFDd6bP/7ZGu+oMMm2XAWnLSIJXBP5DANF TUKAFca4wmggfbz6EWuQALdkYVl0qVXpQgH49LW2kUgZqfJMsamzQw8k9MgG22huOBLp J9/w== 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 r7-20020aa79887000000b0063d23b80e00si3712863pfl.392.2023.06.04.05.27.28; Sun, 04 Jun 2023 05:27:41 -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 S230210AbjFDMVZ (ORCPT + 99 others); Sun, 4 Jun 2023 08:21:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229670AbjFDMVY (ORCPT ); Sun, 4 Jun 2023 08:21:24 -0400 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63DDEB5; Sun, 4 Jun 2023 05:21: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 ac3ac691e1f6ec71; Sun, 4 Jun 2023 14:21:20 +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 C35A1963C55; Sun, 4 Jun 2023 14:21:19 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux ACPI Cc: LKML , Zhang Rui , Daniel Lezcano , Michal Wilczynski , Srinivas Pandruvada Subject: [PATCH v2 7/7] ACPI: thermal: Drop struct acpi_thermal_flags Date: Sun, 04 Jun 2023 14:21:13 +0200 Message-ID: <2581616.Lt9SDvczpP@kreacher> In-Reply-To: <2703629.mvXUDI8C0e@kreacher> References: <2703629.mvXUDI8C0e@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: gggruggvucftvghtrhhoucdtuddrgedvhedrfeeljedgheduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepvdffueeitdfgvddtudegueejtdffteetgeefkeffvdeftddttdeuhfegfedvjefhnecukfhppeduleehrddufeeirdduledrleegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepudelhedrudefiedrudelrdelgedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohepiedprhgtphhtthhopehlihhnuhigqdgrtghpihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehruhhirdiihhgrnhhgsehinhhtvghlrdgtohhmpdhrtghpthhtohepuggrnhhivghlrdhlvgiitggrnhhosehlihhnrghrohdrohhrghdprhgtphhtthhopehm ihgthhgrlhdrfihilhgtiiihnhhskhhisehinhhtvghlrdgtohhmpdhrtghpthhtohepshhrihhnihhvrghsrdhprghnughruhhvrggurgeslhhinhhugidrihhnthgvlhdrtghomh 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,T_SCC_BODY_TEXT_LINE 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?1767775049105603448?= X-GMAIL-MSGID: =?utf-8?q?1767775049105603448?= From: Rafael J. Wysocki Drop struct acpi_thermal_flags which is not really used (only one flag in it is ever set, but it is never read) and call acpi_execute_simple_method() directly to evaluate _SCP instead of using acpi_thermal_set_cooling_mode(), which has no callers after that change, so drop it. No intentional functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Daniel Lezcano --- v1 -> v2: New patch --- drivers/acpi/thermal.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) Index: linux-pm/drivers/acpi/thermal.c =================================================================== --- linux-pm.orig/drivers/acpi/thermal.c +++ linux-pm/drivers/acpi/thermal.c @@ -129,12 +129,6 @@ struct acpi_thermal_trips { struct acpi_thermal_active active[ACPI_THERMAL_MAX_ACTIVE]; }; -struct acpi_thermal_flags { - u8 cooling_mode:1; /* _SCP */ - u8 devices:1; /* _TZD */ - u8 reserved:6; -}; - struct acpi_thermal { struct acpi_device *device; acpi_bus_id name; @@ -142,7 +136,6 @@ struct acpi_thermal { unsigned long last_temperature; unsigned long polling_frequency; volatile u8 zombie; - struct acpi_thermal_flags flags; struct acpi_thermal_trips trips; struct acpi_handle_list devices; struct thermal_zone_device *thermal_zone; @@ -197,18 +190,6 @@ static int acpi_thermal_get_polling_freq return 0; } -static int acpi_thermal_set_cooling_mode(struct acpi_thermal *tz, int mode) -{ - if (!tz) - return -EINVAL; - - if (ACPI_FAILURE(acpi_execute_simple_method(tz->device->handle, - "_SCP", mode))) - return -ENODEV; - - return 0; -} - static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag) { acpi_status status; @@ -926,9 +907,8 @@ static int acpi_thermal_get_info(struct return result; /* Set the cooling mode [_SCP] to active cooling (default) */ - result = acpi_thermal_set_cooling_mode(tz, ACPI_THERMAL_MODE_ACTIVE); - if (!result) - tz->flags.cooling_mode = 1; + acpi_execute_simple_method(tz->device->handle, "_SCP", + ACPI_THERMAL_MODE_ACTIVE); /* Get default polling frequency [_TZP] (optional) */ if (tzp)