From patchwork Mon Dec 5 19:03:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 29893 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2431089wrr; Mon, 5 Dec 2022 11:16:07 -0800 (PST) X-Google-Smtp-Source: AA0mqf6EbAcPORsCXVEFLY9hJjd/5KGQa6yJDstQJjCU14gZtq6nIileNc5N1C0uF6oYtcIxZtbx X-Received: by 2002:aa7:c502:0:b0:46c:6bdc:40fd with SMTP id o2-20020aa7c502000000b0046c6bdc40fdmr8908536edq.74.1670267766984; Mon, 05 Dec 2022 11:16:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670267766; cv=none; d=google.com; s=arc-20160816; b=DrgIH+q701RTR7H/OavlM1cRP7URIdI19P4+BYn0glCctzvh43I5HeL5lIVLunY5iV 97cChrCHPUwUR0oxTAuu7K+OD1+1FDDsQ7pQ8c4vED6LZzwI/jaglOSLcXTIG0hTD2bm fanLPGYbzNikjLuQT6Zf92CjC2P36VSXnIq/fwBukkJNp6QmuvsT29Ouyg8UVpDEAE/G nbp8Cu9aVqHc7IGCw81xImrxWc5X/GwSRD7t63+8+IsttmfSGtVRUTw1ZQz1RehQdil8 3lLM7g0FbPEXnsnFbsjLi4YTdeqcWYdilF4HXP2vSHRhZ3g2AlnHruTCm//2HSiM/jjQ TVxw== 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=fptUepX7sotU72Lf13bT+xSFoK1N4r7bdcc7nfrW5m4=; b=AHPM1E7dCS7idW8wFurXh8OxTjco6b+vRN8St/jE963ucM3Vo6ATOCLYUEPxwpnYbU Y38YJUuP2ijdAA+DqKoXnFgbgy2wUN+5Q18w0ds62pf1lTlV37FCVyDRT+AZR07xB2KO 2Aoe3GpwG1SFueUbe05GweqeQz+8PVVHD+OXm+muaIljj8O12Ni5k4sYMA81eYT1xA/B 75ba3HXsIyrVpaNKCHCDNrYAjKEBM3aXobMbIQ/PvToW/ne7pWUQ1647G9Tq+xG3epza ATUXOYbX20VUAtAtP+R88sF7rXHQAE44ew+VZcYwL9dHjKGslgPvjdQ8YfT3JC+4ICNX Q9Dg== 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 n10-20020a05640205ca00b0046b55b17f1fsi245724edx.567.2022.12.05.11.15.37; Mon, 05 Dec 2022 11:16:06 -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 S233496AbiLETIl (ORCPT + 99 others); Mon, 5 Dec 2022 14:08:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233178AbiLETIX (ORCPT ); Mon, 5 Dec 2022 14:08:23 -0500 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59878E0E9; Mon, 5 Dec 2022 11:08:21 -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 7ac16176b1bff097; Mon, 5 Dec 2022 20:08:19 +0100 Received: from kreacher.localnet (unknown [213.134.188.181]) (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 0501A2801EA0; Mon, 5 Dec 2022 20:08:18 +0100 (CET) Authentication-Results: v370.home.net.pl; dmarc=none (p=none dis=none) header.from=rjwysocki.net Authentication-Results: v370.home.net.pl; spf=fail smtp.mailfrom=rjwysocki.net From: "Rafael J. Wysocki" To: Linux ACPI Cc: LKML , Linux PM , Zhang Rui , Srinivas Pandruvada Subject: [PATCH v1 1/5] ACPI: processor: perflib: Adjust white space Date: Mon, 05 Dec 2022 20:03:30 +0100 Message-ID: <13154277.uLZWGnKmhe@kreacher> In-Reply-To: <1836012.tdWV9SEqCh@kreacher> References: <1836012.tdWV9SEqCh@kreacher> MIME-Version: 1.0 X-CLIENT-IP: 213.134.188.181 X-CLIENT-HOSTNAME: 213.134.188.181 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedrudeggdduvdduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepvdffueeitdfgvddtudegueejtdffteetgeefkeffvdeftddttdeuhfegfedvjefhnecukfhppedvudefrddufeegrddukeekrddukedunecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehinhgvthepvddufedrudefgedrudekkedrudekuddphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohephedprhgtphhtthhopehlihhnuhigqdgrtghpihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhpmhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehruhhirdiihhgrnhhgsehinhhtvghlrdgtohhmpdhrtghpthht ohepshhrihhnihhvrghsrdhprghnughruhhvrggurgeslhhinhhugidrihhnthgvlhdrtghomh X-DCC--Metrics: v370.home.net.pl 1024; Body=5 Fuz1=5 Fuz2=5 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?1751402694336428892?= X-GMAIL-MSGID: =?utf-8?q?1751402694336428892?= From: Rafael J. Wysocki Some inconsistent usage of white space in the ACPI processor performance library code causes that code to be somewhat harder to read that it would have been otherwise, so adjust the white space in there to address that. No expected functional impact. Signed-off-by: Rafael J. Wysocki --- drivers/acpi/processor_perflib.c | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) Index: linux-pm/drivers/acpi/processor_perflib.c =================================================================== --- linux-pm.orig/drivers/acpi/processor_perflib.c +++ linux-pm/drivers/acpi/processor_perflib.c @@ -142,6 +142,7 @@ int acpi_processor_get_bios_limit(int cp pr = per_cpu(processors, cpu); if (!pr || !pr->performance || !pr->performance->state_count) return -ENODEV; + *limit = pr->performance->states[pr->performance_platform_limit]. core_frequency * 1000; return 0; @@ -201,8 +202,7 @@ static int acpi_processor_get_performanc } pct = (union acpi_object *)buffer.pointer; - if (!pct || (pct->type != ACPI_TYPE_PACKAGE) - || (pct->package.count != 2)) { + if (!pct || (pct->type != ACPI_TYPE_PACKAGE) || (pct->package.count != 2)) { pr_err("Invalid _PCT data\n"); result = -EFAULT; goto end; @@ -214,9 +214,9 @@ static int acpi_processor_get_performanc obj = pct->package.elements[0]; - if ((obj.type != ACPI_TYPE_BUFFER) - || (obj.buffer.length < sizeof(struct acpi_pct_register)) - || (obj.buffer.pointer == NULL)) { + if ((obj.type != ACPI_TYPE_BUFFER) || + (obj.buffer.length < sizeof(struct acpi_pct_register)) || + (obj.buffer.pointer == NULL)) { pr_err("Invalid _PCT data (control_register)\n"); result = -EFAULT; goto end; @@ -230,9 +230,9 @@ static int acpi_processor_get_performanc obj = pct->package.elements[1]; - if ((obj.type != ACPI_TYPE_BUFFER) - || (obj.buffer.length < sizeof(struct acpi_pct_register)) - || (obj.buffer.pointer == NULL)) { + if ((obj.type != ACPI_TYPE_BUFFER) || + (obj.buffer.length < sizeof(struct acpi_pct_register)) || + (obj.buffer.pointer == NULL)) { pr_err("Invalid _PCT data (status_register)\n"); result = -EFAULT; goto end; @@ -260,8 +260,8 @@ static void amd_fixup_frequency(struct a if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD) return; - if ((boot_cpu_data.x86 == 0x10 && boot_cpu_data.x86_model < 10) - || boot_cpu_data.x86 == 0x11) { + if ((boot_cpu_data.x86 == 0x10 && boot_cpu_data.x86_model < 10) || + boot_cpu_data.x86 == 0x11) { rdmsr(MSR_AMD_PSTATE_DEF_BASE + index, lo, hi); /* * MSR C001_0064+: @@ -353,8 +353,7 @@ static int acpi_processor_get_performanc * Check that ACPI's u64 MHz will be valid as u32 KHz in cpufreq */ if (!px->core_frequency || - ((u32)(px->core_frequency * 1000) != - (px->core_frequency * 1000))) { + ((u32)(px->core_frequency * 1000) != (px->core_frequency * 1000))) { pr_err(FW_BUG "Invalid BIOS _PSS frequency found for processor %d: 0x%llx MHz\n", pr->id, px->core_frequency); @@ -499,7 +498,6 @@ int acpi_processor_notify_smm(struct mod return 0; } - EXPORT_SYMBOL(acpi_processor_notify_smm); int acpi_processor_get_psd(acpi_handle handle, struct acpi_psd_package *pdomain) @@ -532,8 +530,7 @@ int acpi_processor_get_psd(acpi_handle h state.length = sizeof(struct acpi_psd_package); state.pointer = pdomain; - status = acpi_extract_package(&(psd->package.elements[0]), - &format, &state); + status = acpi_extract_package(&(psd->package.elements[0]), &format, &state); if (ACPI_FAILURE(status)) { pr_err("Invalid _PSD data\n"); result = -EFAULT; @@ -716,9 +713,8 @@ err_out: } EXPORT_SYMBOL(acpi_processor_preregister_performance); -int -acpi_processor_register_performance(struct acpi_processor_performance - *performance, unsigned int cpu) +int acpi_processor_register_performance(struct acpi_processor_performance + *performance, unsigned int cpu) { struct acpi_processor *pr; @@ -751,7 +747,6 @@ acpi_processor_register_performance(stru mutex_unlock(&performance_mutex); return 0; } - EXPORT_SYMBOL(acpi_processor_register_performance); void acpi_processor_unregister_performance(unsigned int cpu) @@ -768,11 +763,11 @@ void acpi_processor_unregister_performan if (pr->performance) kfree(pr->performance->states); + pr->performance = NULL; mutex_unlock(&performance_mutex); return; } - EXPORT_SYMBOL(acpi_processor_unregister_performance); From patchwork Mon Dec 5 19:04:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 29902 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2431499wrr; Mon, 5 Dec 2022 11:17:00 -0800 (PST) X-Google-Smtp-Source: AA0mqf78KsXT+PZwfr6HkkZNLjZi6aLuw2s+Wcv++2nFCpOgOsh58TbQHk84z2k4++UDHvdXPWtl X-Received: by 2002:a17:906:6417:b0:7ae:937f:2c38 with SMTP id d23-20020a170906641700b007ae937f2c38mr55465935ejm.201.1670267820720; Mon, 05 Dec 2022 11:17:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670267820; cv=none; d=google.com; s=arc-20160816; b=ozFrvRCzA1idJHqCoc8ju6yGr1KHZHOm5Z8EOdCvJOFF3fbD2fLarKl/M2v52M3ioc jF1+5dP6miP1UeCVuVmGyIaXfArY4hF0CPQJot2bLtzmsF9U/vCqt6vJEOQUg7kaZ3k6 Ik7eiKMBRqPfIVeW/A+S1my7kNi/1/qsZS/5YGcHOjQx+e9B8IinNvkcgm+BgUK1sCSv RJRZqmOhT7OtazFf6mrq/94aueRTXlLJEECrA5Y6wk5UDUafFtwzSC+LMAImZZ7j9XYt W1IexMlod3AIF5HUYbrkLhvwfrSIJTHq7Z8KHdbXt6WF/jcEejNfwmxJC4nsm4cZtQuY NM3g== 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=KB2r5NMk+z4f5hqZgzrBZEXiHuwoR1Pkil3dMKYUmU8=; b=LU21fUzBTN7tmYNdYwDkHraAz48lcKXd157rbhLRdnjCo8aNCL2PTkze2Y6GEkRWQz Bkq1NF0wWoW+XUUgJLcrxX+VBjSUoUVp1vvCXDUS5l4twj02q2z/1G4daOh+TKiRlRs6 X7fXJEsDosTztHDWXnFArGSYE5LcWsgAUBMlLh/36+548t9sLOOPGvOb9Ll0iUC18LT4 W65IMTsUG2ZjbmjaSUWCklRrrEjpSd73wTvVc/FnCzsHQRWRH2LkPpn6nzONaYYoitQ+ sc9evfRkzOxIa4MdB9qSZVV6RR3gW7m59MLur/l/rUJgkkqLBCAAkprKW2JnZZfzT8nJ E35Q== 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 z14-20020a05640235ce00b00461d726439asi262224edc.538.2022.12.05.11.16.35; Mon, 05 Dec 2022 11:17:00 -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 S233157AbiLETIg (ORCPT + 99 others); Mon, 5 Dec 2022 14:08:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232919AbiLETIW (ORCPT ); Mon, 5 Dec 2022 14:08:22 -0500 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B739E0B9; Mon, 5 Dec 2022 11:08:19 -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 c49bb09df78b58ef; Mon, 5 Dec 2022 20:08:18 +0100 Received: from kreacher.localnet (unknown [213.134.188.181]) (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 5B6622801EA0; Mon, 5 Dec 2022 20:08:17 +0100 (CET) Authentication-Results: v370.home.net.pl; dmarc=none (p=none dis=none) header.from=rjwysocki.net Authentication-Results: v370.home.net.pl; spf=fail smtp.mailfrom=rjwysocki.net From: "Rafael J. Wysocki" To: Linux ACPI Cc: LKML , Linux PM , Zhang Rui , Srinivas Pandruvada Subject: [PATCH v1 2/5] ACPI: processor: perflib: Drop redundant parentheses Date: Mon, 05 Dec 2022 20:04:59 +0100 Message-ID: <3202314.aeNJFYEL58@kreacher> In-Reply-To: <1836012.tdWV9SEqCh@kreacher> References: <1836012.tdWV9SEqCh@kreacher> MIME-Version: 1.0 X-CLIENT-IP: 213.134.188.181 X-CLIENT-HOSTNAME: 213.134.188.181 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedrudeggdduvdduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepvdffueeitdfgvddtudegueejtdffteetgeefkeffvdeftddttdeuhfegfedvjefhnecukfhppedvudefrddufeegrddukeekrddukedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvddufedrudefgedrudekkedrudekuddphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohephedprhgtphhtthhopehlihhnuhigqdgrtghpihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhpmhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehruhhirdiihhgrnhhgsehinhhtvghlrdgtohhmpdhrtghpthht ohepshhrihhnihhvrghsrdhprghnughruhhvrggurgeslhhinhhugidrihhnthgvlhdrtghomh X-DCC--Metrics: v370.home.net.pl 1024; Body=5 Fuz1=5 Fuz2=5 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?1751402750395347687?= X-GMAIL-MSGID: =?utf-8?q?1751402750395347687?= From: Rafael J. Wysocki Drop some redundant parentheses and rearrange some checks using them in the ACPI processor performance library code for better code clarity. No expected functional impact. Signed-off-by: Rafael J. Wysocki --- drivers/acpi/processor_perflib.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) Index: linux-pm/drivers/acpi/processor_perflib.c =================================================================== --- linux-pm.orig/drivers/acpi/processor_perflib.c +++ linux-pm/drivers/acpi/processor_perflib.c @@ -202,7 +202,7 @@ static int acpi_processor_get_performanc } pct = (union acpi_object *)buffer.pointer; - if (!pct || (pct->type != ACPI_TYPE_PACKAGE) || (pct->package.count != 2)) { + if (!pct || pct->type != ACPI_TYPE_PACKAGE || pct->package.count != 2) { pr_err("Invalid _PCT data\n"); result = -EFAULT; goto end; @@ -214,9 +214,8 @@ static int acpi_processor_get_performanc obj = pct->package.elements[0]; - if ((obj.type != ACPI_TYPE_BUFFER) || - (obj.buffer.length < sizeof(struct acpi_pct_register)) || - (obj.buffer.pointer == NULL)) { + if (!obj.buffer.pointer || obj.type != ACPI_TYPE_BUFFER || + obj.buffer.length < sizeof(struct acpi_pct_register)) { pr_err("Invalid _PCT data (control_register)\n"); result = -EFAULT; goto end; @@ -230,9 +229,8 @@ static int acpi_processor_get_performanc obj = pct->package.elements[1]; - if ((obj.type != ACPI_TYPE_BUFFER) || - (obj.buffer.length < sizeof(struct acpi_pct_register)) || - (obj.buffer.pointer == NULL)) { + if (!obj.buffer.pointer || obj.type != ACPI_TYPE_BUFFER || + obj.buffer.length < sizeof(struct acpi_pct_register)) { pr_err("Invalid _PCT data (status_register)\n"); result = -EFAULT; goto end; @@ -300,7 +298,7 @@ static int acpi_processor_get_performanc } pss = buffer.pointer; - if (!pss || (pss->type != ACPI_TYPE_PACKAGE)) { + if (!pss || pss->type != ACPI_TYPE_PACKAGE) { pr_err("Invalid _PSS data\n"); result = -EFAULT; goto end; @@ -353,7 +351,7 @@ static int acpi_processor_get_performanc * Check that ACPI's u64 MHz will be valid as u32 KHz in cpufreq */ if (!px->core_frequency || - ((u32)(px->core_frequency * 1000) != (px->core_frequency * 1000))) { + (u32)(px->core_frequency * 1000) != px->core_frequency * 1000) { pr_err(FW_BUG "Invalid BIOS _PSS frequency found for processor %d: 0x%llx MHz\n", pr->id, px->core_frequency); @@ -515,7 +513,7 @@ int acpi_processor_get_psd(acpi_handle h } psd = buffer.pointer; - if (!psd || (psd->type != ACPI_TYPE_PACKAGE)) { + if (!psd || psd->type != ACPI_TYPE_PACKAGE) { pr_err("Invalid _PSD data\n"); result = -EFAULT; goto end; From patchwork Mon Dec 5 19:05:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 29891 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2430352wrr; Mon, 5 Dec 2022 11:14:43 -0800 (PST) X-Google-Smtp-Source: AA0mqf6aazgdqhn5K0o6GNSGgh+q5xvHA40BtWdXbV6CxM3iyBFvtZr3jKC1g7jEL9TqcfJkfDmC X-Received: by 2002:a05:6402:3892:b0:454:cbef:c161 with SMTP id fd18-20020a056402389200b00454cbefc161mr58339461edb.365.1670267683193; Mon, 05 Dec 2022 11:14:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670267683; cv=none; d=google.com; s=arc-20160816; b=Otp46QblsJo09Nq6g6qhgIRnCs9xLcVfBrhh1VPbF/isU0F4RdDvkSvXu1em5icQoZ X8PWbvx6rckURhfvuH2qQuAnxYJ46SS5wZWm7bq0DQyF9jl5qAW4YIWuYWDgFfUSFE/e 0oJ3fMv8Je2/FPp+gzFNka7/oBulbU5KN8LQ/zDtvTwS1VWNNJ6YiLMgIoSXx3nudnWj BVwwGQd13SsWe8R939brktIgIokAfCxAvQIlrcgz5qQN01a0mtXwPKvW3JKzf1paKxVW qAb7owQZfwxz8otN1gfy3a6now8woNELYUzSe261H4tocO3N37/l+0zYUTmwKgK57H0u DqwA== 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=bEJCn5Q8WyoSCRrq8iVtHIAjn2dTwPi8pAtiTJbNvHI=; b=hHIjr34e/MUUw3PqviERzMYr5/7wjYw6W/gnXkWGxXnIyjRRZEAeyNbY991596O91J s6nYopx9lpAVuOl6JAgXwMDHgjWqOp57/eecfMy8L+5FUxY5l49Hx3c8r4O9fWa5cd05 ikGIgChvqCgLApRfdhj6j4BJqKoexMI+2InROLlmp5HwQ5KI8L3SvBJPBdmwvAU59hcS /c0Fz61hmgvCGBAAcxMaPuMctIAoWLu/uR57NUu2didXxxt+OKshOUNNdOqDWN3BrhVw 7JJfVwhqDakkbYtJV0qLscwAVzU2l2IuS23T1Hi3jlvT8yyavGhf0Ts24wOsdMZow1i+ Xb4g== 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 xf11-20020a17090731cb00b00792e39c31dcsi12342303ejb.988.2022.12.05.11.14.20; Mon, 05 Dec 2022 11:14:43 -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 S232031AbiLETId (ORCPT + 99 others); Mon, 5 Dec 2022 14:08:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230352AbiLETIT (ORCPT ); Mon, 5 Dec 2022 14:08:19 -0500 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4588DF5B; Mon, 5 Dec 2022 11:08:17 -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 3df8c0bb3010c900; Mon, 5 Dec 2022 20:08:16 +0100 Received: from kreacher.localnet (unknown [213.134.188.181]) (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 8420A2801EA0; Mon, 5 Dec 2022 20:08:15 +0100 (CET) Authentication-Results: v370.home.net.pl; dmarc=none (p=none dis=none) header.from=rjwysocki.net Authentication-Results: v370.home.net.pl; spf=fail smtp.mailfrom=rjwysocki.net From: "Rafael J. Wysocki" To: Linux ACPI Cc: LKML , Linux PM , Zhang Rui , Srinivas Pandruvada Subject: [PATCH v1 3/5] ACPI: processor: perflib: Rearrange unregistration routine Date: Mon, 05 Dec 2022 20:05:55 +0100 Message-ID: <8150213.T7Z3S40VBb@kreacher> In-Reply-To: <1836012.tdWV9SEqCh@kreacher> References: <1836012.tdWV9SEqCh@kreacher> MIME-Version: 1.0 X-CLIENT-IP: 213.134.188.181 X-CLIENT-HOSTNAME: 213.134.188.181 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedrudeggdduvdduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepvdffueeitdfgvddtudegueejtdffteetgeefkeffvdeftddttdeuhfegfedvjefhnecukfhppedvudefrddufeegrddukeekrddukedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvddufedrudefgedrudekkedrudekuddphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohephedprhgtphhtthhopehlihhnuhigqdgrtghpihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhpmhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehruhhirdiihhgrnhhgsehinhhtvghlrdgtohhmpdhrtghpthht ohepshhrihhnihhvrghsrdhprghnughruhhvrggurgeslhhinhhugidrihhnthgvlhdrtghomh X-DCC--Metrics: v370.home.net.pl 1024; Body=5 Fuz1=5 Fuz2=5 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?1751402606198141683?= X-GMAIL-MSGID: =?utf-8?q?1751402606198141683?= From: Rafael J. Wysocki Rearrange acpi_processor_unregister_performance() to follow a more common error handling pattern and drop a redundant "return" statement from the end of it. No expected functional impact. Signed-off-by: Rafael J. Wysocki --- drivers/acpi/processor_perflib.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) Index: linux-pm/drivers/acpi/processor_perflib.c =================================================================== --- linux-pm.orig/drivers/acpi/processor_perflib.c +++ linux-pm/drivers/acpi/processor_perflib.c @@ -754,18 +754,15 @@ void acpi_processor_unregister_performan mutex_lock(&performance_mutex); pr = per_cpu(processors, cpu); - if (!pr) { - mutex_unlock(&performance_mutex); - return; - } + if (!pr) + goto unlock; if (pr->performance) kfree(pr->performance->states); pr->performance = NULL; +unlock: mutex_unlock(&performance_mutex); - - return; } EXPORT_SYMBOL(acpi_processor_unregister_performance); From patchwork Mon Dec 5 19:07:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 29892 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2430467wrr; Mon, 5 Dec 2022 11:14:59 -0800 (PST) X-Google-Smtp-Source: AA0mqf6PEeY81BGFOCfY23xKRuM7Fozlywn4lGtwy6+icizCp/49vucbj0zW7S+uJ6BsxA0GoLFo X-Received: by 2002:a17:907:874f:b0:7b5:e91:adf9 with SMTP id qo15-20020a170907874f00b007b50e91adf9mr44853702ejc.277.1670267699528; Mon, 05 Dec 2022 11:14:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670267699; cv=none; d=google.com; s=arc-20160816; b=cvjrU+zZpkqyIJ9raFQ7qDqGjTpcr6TWyYpDZfASuQ1ghfLnrZv1+h9TEqwQVtrQba jVY7yzFGIVc4/e3Pt1X7KhclAnzxLWmJNiwOlQr40uYaFcnkrtltny2L4DbWYwZ1g1If VYVCev9I32Z+vuQJgjlWR5PAbntdWKYS2b5qDHXclL/PZJlQq9tGm7Nh2cFVp86Fc6Sq d54AGD1IS7OoTcPgRezLP1T2v+HWD19l+EVA/O+GW2U/ENP2jxBbIOU1RBBR7GUo4DJ2 0ASKYmi92Tz0wc+d9nSTrZiooKLiVrFV8v0eQ0feAG9SKvMCSGgirjRwFmG3C/Lf4+Ej GSPQ== 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=SR6dUtA+EryeyATRFpolUd4Zcg1Lx2QKFCn3kWuye08=; b=oJWvmCRaQ1ORW7Eq5XuinttdIKzSJohIBkgoCFsC+8Gl9qXoa/tuh/Ev+bdYSi0M1H luJJQWzHNfemP0+Sc97y0Rx0C/9T2Fo5hfa7CofjSObGTIymmMgOW5ZPb1DsXfGYa1Hk kjlFMUy6h6mdhg/ZeIBjE6jcAO5k+2pcoMak9aYYORveYrzEiacD7VJBz82mYCoSY0uF 0n/myzLgUkWK5XO4djiZjNWg++0JRAC8HDjdC5jaUnMHUxIiCUye4gttHCdNLVK3RE3p WIiYCOTNb+hWfBGY3SDOOSlYPI+jshTWWeSqaeu2CJx6YDdF+SuBWaL8IAAEpd3wT/zg uW/g== 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 j22-20020aa7ca56000000b004542e6bd242si202881edt.621.2022.12.05.11.14.36; Mon, 05 Dec 2022 11:14:59 -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 S233425AbiLETI0 (ORCPT + 99 others); Mon, 5 Dec 2022 14:08:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232300AbiLETIR (ORCPT ); Mon, 5 Dec 2022 14:08:17 -0500 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 478B5DF36; Mon, 5 Dec 2022 11:08:16 -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 9a9b99851343d4ad; Mon, 5 Dec 2022 20:08:14 +0100 Received: from kreacher.localnet (unknown [213.134.188.181]) (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 01BE02801EA0; Mon, 5 Dec 2022 20:08:13 +0100 (CET) Authentication-Results: v370.home.net.pl; dmarc=none (p=none dis=none) header.from=rjwysocki.net Authentication-Results: v370.home.net.pl; spf=fail smtp.mailfrom=rjwysocki.net From: "Rafael J. Wysocki" To: Linux ACPI Cc: LKML , Linux PM , Zhang Rui , Srinivas Pandruvada Subject: [PATCH v1 4/5] ACPI: processor: perflib: Rearrange acpi_processor_notify_smm() Date: Mon, 05 Dec 2022 20:07:08 +0100 Message-ID: <2206087.iZASKD2KPV@kreacher> In-Reply-To: <1836012.tdWV9SEqCh@kreacher> References: <1836012.tdWV9SEqCh@kreacher> MIME-Version: 1.0 X-CLIENT-IP: 213.134.188.181 X-CLIENT-HOSTNAME: 213.134.188.181 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedrudeggdduvdduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepvdffueeitdfgvddtudegueejtdffteetgeefkeffvdeftddttdeuhfegfedvjefhnecukfhppedvudefrddufeegrddukeekrddukedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvddufedrudefgedrudekkedrudekuddphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohephedprhgtphhtthhopehlihhnuhigqdgrtghpihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhpmhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehruhhirdiihhgrnhhgsehinhhtvghlrdgtohhmpdhrtghpthht ohepshhrihhnihhvrghsrdhprghnughruhhvrggurgeslhhinhhugidrihhnthgvlhdrtghomh X-DCC--Metrics: v370.home.net.pl 1024; Body=5 Fuz1=5 Fuz2=5 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?1751402623099981894?= X-GMAIL-MSGID: =?utf-8?q?1751402623099981894?= From: Rafael J. Wysocki Rearrange the code in acpi_processor_notify_smm() to consolidate error handling in it and improve the comments in there while at it. No expected functional impact. Signed-off-by: Rafael J. Wysocki --- drivers/acpi/processor_perflib.c | 52 ++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 27 deletions(-) Index: linux-pm/drivers/acpi/processor_perflib.c =================================================================== --- linux-pm.orig/drivers/acpi/processor_perflib.c +++ linux-pm/drivers/acpi/processor_perflib.c @@ -453,7 +453,7 @@ int acpi_processor_pstate_control(void) int acpi_processor_notify_smm(struct module *calling_module) { static int is_done; - int result; + int result = 0; if (!acpi_processor_cpufreq_init) return -EBUSY; @@ -461,40 +461,38 @@ int acpi_processor_notify_smm(struct mod if (!try_module_get(calling_module)) return -EINVAL; - /* is_done is set to negative if an error occurred, - * and to postitive if _no_ error occurred, but SMM - * was already notified. This avoids double notification - * which might lead to unexpected results... + /* + * is_done is set to negative if an error occurs and to 1 if no error + * occurrs, but SMM has been notified already. This avoids repeated + * notification which might lead to unexpected results. */ - if (is_done > 0) { - module_put(calling_module); - return 0; - } else if (is_done < 0) { - module_put(calling_module); - return is_done; - } + if (is_done != 0) { + if (is_done < 0) + result = is_done; - is_done = -EIO; + goto out_put; + } result = acpi_processor_pstate_control(); - if (!result) { - pr_debug("No SMI port or pstate_control\n"); - module_put(calling_module); - return 0; - } - if (result < 0) { - module_put(calling_module); - return result; + if (result <= 0) { + if (!result) + pr_debug("No SMI port or pstate_control\n"); + + is_done = -EIO; + goto out_put; } - /* Success. If there's no _PPC, we need to fear nothing, so - * we can allow the cpufreq driver to be rmmod'ed. */ is_done = 1; + /* + * Success. If there _PPC, unloading the cpufreq driver would be risky, + * so disallow it in that case. + */ + if (acpi_processor_ppc_in_use) + return 0; - if (!acpi_processor_ppc_in_use) - module_put(calling_module); - - return 0; +out_put: + module_put(calling_module); + return result; } EXPORT_SYMBOL(acpi_processor_notify_smm); From patchwork Mon Dec 5 19:08:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 29890 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2430292wrr; Mon, 5 Dec 2022 11:14:34 -0800 (PST) X-Google-Smtp-Source: AA0mqf4l9iFO9qMvICrLSnR29NGyGpvwRt5DIcQhs35I/MaVf7mZwzo5xFoXfpM2vuDIduPz5BIT X-Received: by 2002:a17:906:99cb:b0:7bb:7dda:7d3c with SMTP id s11-20020a17090699cb00b007bb7dda7d3cmr22359001ejn.182.1670267674347; Mon, 05 Dec 2022 11:14:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670267674; cv=none; d=google.com; s=arc-20160816; b=r9Uh5wm4MqdunY06pzNi8covQg55Zsc6gURpkS4E1NrETBWpXXLOsuBS9ZWhiFdI4X yrT2Vqqyemem4fs/uQwgaCySvZ6yS4KhvIX4Xztuuv9K2/nvx1iO5xAzGWe20V3lk2qb 6AFZYOuFDH6Hz+AqK945n9d/kBb5ZO6qfVTq2Ko8bnK4wMYtSht09I61NTh2/IqknGAw 1759vyIjfJ9LKmNexUISxPcCXvlRd30b9PvV9o1lQ50hWfOwoxkjzbFsAQhfHdnBW/XE +jPwkzt+5CFyVoW1Dirq0VmaXajlGcLQOzUEbKSJiT1br5D3yqCEZpaCGHfDqbhoqZO3 KW1w== 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=dzBM01KCLbRyuPze19sOCfYJEY4mZ+70HROFKkDOAn4=; b=Ov8Cq5tYy8ksCJeGwQhKtEZF0Fnd4PZCU6AqispR0VtXPdrl3Sumhqn/2RKrWLijcJ IAjH6HU8gHXwDxPKS0U7Oaqfv+oOMJjI4iiGnwANVyEC9dhCR4WcGla2V7XPASllld2/ PfEstb6CN2sUJvV6EHr+oscyH4Vj43nVycDxE10ogkYM9vbmFngLqBsfdk4tDmfRX7K0 S6SgqlbyZf/HqylC7a27E622PB+pOQ7shtYlOFbwyrwh2rDbvkxHMVDHR1N2DWDjFQlz wUzUOZnM0/JD6V8JAMnsFCyWbLI2xxzrtthLNXYnF+He55z/asZnGW7oplkdhnatk3oX t5Hg== 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 k14-20020a170906a38e00b007c0a7286cbesi9061515ejz.708.2022.12.05.11.14.11; Mon, 05 Dec 2022 11:14: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 S232490AbiLETIQ (ORCPT + 99 others); Mon, 5 Dec 2022 14:08:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230352AbiLETIP (ORCPT ); Mon, 5 Dec 2022 14:08:15 -0500 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2826DDF33; Mon, 5 Dec 2022 11:08:14 -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 517f8ee01c49655d; Mon, 5 Dec 2022 20:08:12 +0100 Received: from kreacher.localnet (unknown [213.134.188.181]) (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 C38072801EA0; Mon, 5 Dec 2022 20:08:11 +0100 (CET) Authentication-Results: v370.home.net.pl; dmarc=none (p=none dis=none) header.from=rjwysocki.net Authentication-Results: v370.home.net.pl; spf=fail smtp.mailfrom=rjwysocki.net From: "Rafael J. Wysocki" To: Linux ACPI Cc: LKML , Linux PM , Zhang Rui , Srinivas Pandruvada Subject: [PATCH v1 5/5] ACPI: processor: perflib: Adjust acpi_processor_notify_smm() return value Date: Mon, 05 Dec 2022 20:08:00 +0100 Message-ID: <21694351.EfDdHjke4D@kreacher> In-Reply-To: <1836012.tdWV9SEqCh@kreacher> References: <1836012.tdWV9SEqCh@kreacher> MIME-Version: 1.0 X-CLIENT-IP: 213.134.188.181 X-CLIENT-HOSTNAME: 213.134.188.181 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedrudeggdduvdduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepvdffueeitdfgvddtudegueejtdffteetgeefkeffvdeftddttdeuhfegfedvjefhnecukfhppedvudefrddufeegrddukeekrddukedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvddufedrudefgedrudekkedrudekuddphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohephedprhgtphhtthhopehlihhnuhigqdgrtghpihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhpmhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehruhhirdiihhgrnhhgsehinhhtvghlrdgtohhmpdhrtghpthht ohepshhrihhnihhvrghsrdhprghnughruhhvrggurgeslhhinhhugidrihhnthgvlhdrtghomh X-DCC--Metrics: v370.home.net.pl 1024; Body=5 Fuz1=5 Fuz2=5 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?1751402596850662648?= X-GMAIL-MSGID: =?utf-8?q?1751402596850662648?= From: Rafael J. Wysocki Avoid returning a confusing error code from acpi_processor_notify_smm() if it is called for the second time in the case when SMM notification regarding P-state control is not supported. Signed-off-by: Rafael J. Wysocki --- drivers/acpi/processor_perflib.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) Index: linux-pm/drivers/acpi/processor_perflib.c =================================================================== --- linux-pm.orig/drivers/acpi/processor_perflib.c +++ linux-pm/drivers/acpi/processor_perflib.c @@ -475,10 +475,12 @@ int acpi_processor_notify_smm(struct mod result = acpi_processor_pstate_control(); if (result <= 0) { - if (!result) + if (result) { + is_done = result; + } else { pr_debug("No SMI port or pstate_control\n"); - - is_done = -EIO; + is_done = 1; + } goto out_put; }