Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp728694pxj; Wed, 16 Jun 2021 12:10:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylUeL2A3ds8+8lvVyZZaZTdGYKotlApuxBUpbIJ7C/Yie04+hGVe/kIRXcI9a+Zy6xo6YF X-Received: by 2002:a17:906:3884:: with SMTP id q4mr1122990ejd.66.1623870613918; Wed, 16 Jun 2021 12:10:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623870613; cv=none; d=google.com; s=arc-20160816; b=pArP64/xtNPHDxWmLUiBgMia/t1Ca111BjjAyrVbawKPyGip8FjqBYlZBsj/Os/a26 2Y6ADHrGaFwYHFO22eoYPlTET6JVU6j7rDSdowWFbEcDt6bq1lkCr9wR/mHcOOviGypA O8uNZfm/JyWMagW2FSCwwo8tjoniBSaG0dt+XkDoFV91AR6QePA6Xm2nnn4CMbR5HseL whTzTiP5pdwRklANVkYNlaRMNuQCuw1fIR5B7B4YZvm4mYYMP62T3FkMaChIh6h+yeW5 LzRxsCOniq5Kpw61SG3eMuNYqFo23LUKnoCS+BGJQ8eB6stWu/Mw2berK6LEld5Z0UjU LvEg== 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=Qeufclw/I0VV3LGvSRFNVicd1RPOKLL0c3LtqgSS3gg=; b=zpmax8n+JXrhPmwsrHVpzuLqR6Gbb4LmDITl7/jLnmEAHWb50uNsvpyWtYudKFs67N NqTLhWXywyrTdsSsIh8pvJqwkOlhoLTS4g5pNQzmKmHlVRNToLrAPGiGHi7Sh+NHx95D g8b8OB6bWFd6nOlj6FA082SssLe1DcuD9+JFecZe0ZO941VGkMW/ENaoAxBdf9FfvgKS FgZlGhCudcDvAzUrOaggAYwUcjrtxPtRb6vC7IZbobUGtI12sLYLBpqCBOoaDMD7koGK UOH63LXkIAi/CNZW8fSpprbCwI5FcTTqmYVHcpCtbXR4ZVW0YfFKYrXS64U7Y6TIP5+j Wa1w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id aq5si3053150ejc.19.2021.06.16.12.09.51; Wed, 16 Jun 2021 12:10:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234006AbhFPO2l (ORCPT + 99 others); Wed, 16 Jun 2021 10:28:41 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:62358 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234013AbhFPO2a (ORCPT ); Wed, 16 Jun 2021 10:28:30 -0400 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 2.1.0) id de9fe55ee3a221b7; Wed, 16 Jun 2021 16:26:23 +0200 Received: from kreacher.localnet (89-64-81-4.dynamic.chello.pl [89.64.81.4]) (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 53E5D669926; Wed, 16 Jun 2021 16:26:22 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux ACPI Cc: LKML , Hans de Goede Subject: [PATCH 1/5] ACPI: scan: Rearrange acpi_dev_get_first_consumer_dev_cb() Date: Wed, 16 Jun 2021 16:21:51 +0200 Message-ID: <9924939.nUPlyArG6x@kreacher> In-Reply-To: <3140195.44csPzL39Z@kreacher> References: <3140195.44csPzL39Z@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 89.64.81.4 X-CLIENT-HOSTNAME: 89-64-81-4.dynamic.chello.pl X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduledrfedvledgjeejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufffkjghfggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpedvjeelgffhiedukedtleekkedvudfggefhgfegjefgueekjeelvefggfdvledutdenucfkphepkeelrdeigedrkedurdegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepkeelrdeigedrkedurdegpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhrtghpthhtoheplhhinhhugidqrggtphhisehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohephhguvghgohgvuggvsehrvgguhhgrthdrtghomh X-DCC--Metrics: v370.home.net.pl 1024; Body=3 Fuz1=3 Fuz2=3 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki Make acpi_dev_get_first_consumer_dev_cb() a bit more straightforward and rewrite the comment in it. No functional impact. Signed-off-by: Rafael J. Wysocki --- drivers/acpi/scan.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) Index: linux-pm/drivers/acpi/scan.c =================================================================== --- linux-pm.orig/drivers/acpi/scan.c +++ linux-pm/drivers/acpi/scan.c @@ -2107,13 +2107,12 @@ static int acpi_dev_get_first_consumer_d struct acpi_device *adev; adev = acpi_bus_get_acpi_device(dep->consumer); - if (!adev) - /* If we don't find an adev then we want to continue parsing */ - return 0; - - *(struct acpi_device **)data = adev; - - return 1; + if (adev) { + *(struct acpi_device **)data = adev; + return 1; + } + /* Continue parsing if the device object is not present. */ + return 0; } static int acpi_scan_clear_dep(struct acpi_dep_data *dep, void *data)