Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3609743pxb; Wed, 13 Oct 2021 09:18:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0uga8BYo30lkV9i0D4+PSHojI+kxz3lQz7Erb7gHxJQvnu8+uNXKXGqFZnXZ+jmyxC1ol X-Received: by 2002:a05:6a00:b8f:b0:44c:6220:3396 with SMTP id g15-20020a056a000b8f00b0044c62203396mr297588pfj.58.1634141937344; Wed, 13 Oct 2021 09:18:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634141937; cv=none; d=google.com; s=arc-20160816; b=WgH5+R2YujVMGQdQ3r8xmU1m1F2fj+VwxF7TFPD4kCt1DRyMSyfIwVp+dnPsIoAh93 gaAT/qTdyQzth/LmXS0ODaFH3f/1b2gn0g4GtsuOv5GW+6WinHmsDckZYodq0arf7Ri8 ZL7ikEUQB3XRau7RN34249b5mmtiLt6sZ2rXF2qVnZPKIBT0yagePbM/ioPgnmcjFNoz EL8hhnqWjKM177lABtFL1TGzMYtvZ0VAnxGT0R5P5bYMrGlhPLaDK5L0UdsyWnN2x5TN 8i02m8VULLPrypWw69w6XmhB2d+Q8DiZWFyQWebbQwT91Lij8QkwlEv4CS8hJhcc6Dec ej6w== 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=QiGboOtz8wWmXt6hG40YfrYHWi+xQnCKEZ8DAOV5WME=; b=0ovD9zA5Mv9mlnNg81LSn/rERaEUWYGzpeOWoxtq/0QmgEvUjesBS7WeWeIEo+ca1u uBmI7tQUIaN86W1S46cEvo2ciBlqtF4Mhfm2gTvd1OQ7CS1W37ziLfZIK997hgc0wEk3 QPJEm/mL6HiemQYBOt0V4BI2WYrNV636mu2iiE2go5e3W9XVNIPmeajU5d/7SesLofL6 urTyn8ZwmSXQ/P9Bpk7KJeK4Tx1cG0py5v5OFJlHOuIpVvOQMHwbmnxtdhi2pFWniDij bXReNQ5Es/EY6aNQyQvkFLdjZ6twVYUes5ChoJV3C8YQMQFVUtLfDqDEAiqK3UUXmo/S olCQ== 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 12si10068496pjl.32.2021.10.13.09.18.18; Wed, 13 Oct 2021 09:18:57 -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 S236277AbhJMQSp (ORCPT + 99 others); Wed, 13 Oct 2021 12:18:45 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:61416 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236058AbhJMQSi (ORCPT ); Wed, 13 Oct 2021 12:18:38 -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 3.0.0) id 7a498f931a4fc918; Wed, 13 Oct 2021 18:16:33 +0200 Received: from kreacher.localnet (unknown [213.134.161.244]) (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 CAACC66A871; Wed, 13 Oct 2021 18:16:32 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux ACPI , Maximilian Luz Cc: LKML , Hans de Goede , Mark Gross , platform-driver-x86@vger.kernel.org Subject: [PATCH v3 5/7] surface: surface3_power: Drop redundant acpi_bus_get_device() call Date: Wed, 13 Oct 2021 18:12:31 +0200 Message-ID: <3160001.aeNJFYEL58@kreacher> In-Reply-To: <2503491.Lt9SDvczpP@kreacher> References: <4369779.LvFx2qVVIh@kreacher> <3089655.5fSG56mABF@kreacher> <2503491.Lt9SDvczpP@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 213.134.161.244 X-CLIENT-HOSTNAME: 213.134.161.244 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvtddrudeljedguddtfecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepvdejlefghfeiudektdelkeekvddugfeghffggeejgfeukeejleevgffgvdeluddtnecukfhppedvudefrddufeegrdduiedurddvgeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvddufedrudefgedrudeiuddrvdeggedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedprhgtphhtthhopehlihhnuhigqdgrtghpihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehluhiimhgrgihimhhilhhirghnsehgmhgrihhlrdgtohhmpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohephhguvghgohgvuggvsehrvgguhhgrthdrtghomhdprhgtphhtthhopehmghhrohhssheslhhinhhu gidrihhnthgvlhdrtghomhdprhgtphhtthhopehplhgrthhfohhrmhdqughrihhvvghrqdigkeeisehvghgvrhdrkhgvrhhnvghlrdhorhhg X-DCC--Metrics: v370.home.net.pl 1024; Body=6 Fuz1=6 Fuz2=6 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki If the ACPI companion of a given device is not present, the result of the ACPI_HANDLE() evaluation for it will be NULL, so calling acpi_bus_get_device() on ACPI_HANDLE() result in order to validate it is redundant. Drop the redundant acpi_bus_get_device() call from mshw0011_notify() along with a local variable related to it. No intentional functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Maximilian Luz --- v2 -> v3: * Resend with a different From and S-o-b address and with R-by from Maximilian. No other changes. --- drivers/platform/surface/surface3_power.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) Index: linux-pm/drivers/platform/surface/surface3_power.c =================================================================== --- linux-pm.orig/drivers/platform/surface/surface3_power.c +++ linux-pm/drivers/platform/surface/surface3_power.c @@ -159,12 +159,11 @@ mshw0011_notify(struct mshw0011_data *cd unsigned int *ret_value) { union acpi_object *obj; - struct acpi_device *adev; acpi_handle handle; unsigned int i; handle = ACPI_HANDLE(&cdata->adp1->dev); - if (!handle || acpi_bus_get_device(handle, &adev)) + if (!handle) return -ENODEV; obj = acpi_evaluate_dsm_typed(handle, &mshw0011_guid, arg1, arg2, NULL,