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;