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: 631485 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 952F9C63703 for ; Mon, 5 Dec 2022 19:08:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232883AbiLETI0 (ORCPT ); Mon, 5 Dec 2022 14:08:26 -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 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 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;