From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6FF2C76196 for ; Mon, 22 Jul 2019 08:30:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 749A82199C for ; Mon, 22 Jul 2019 08:30:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563784210; bh=jFyD1bLi5IbBr2NaSYByE/QZUvoo+ll41vptjR/XU44=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=ogjO/Spjo0zHQMjw2ZB46Qn3oxxyUc+uoXDK6pibhKuxk2mXR011/vadKRMX41ZRL MoqUqAp9ksqh0Rk9KkI8XkpKxjzuYhya+AcmTvmB9pBtxpxWRDOVLu5gYNvbKrq6c2 H5mW4R7EMPZuNxCiEHLqH7N5lSpYQwCSDRx41/SQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728428AbfGVIaJ (ORCPT ); Mon, 22 Jul 2019 04:30:09 -0400 Received: from mail-oi1-f196.google.com ([209.85.167.196]:45652 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727304AbfGVIaJ (ORCPT ); Mon, 22 Jul 2019 04:30:09 -0400 Received: by mail-oi1-f196.google.com with SMTP id m206so28966986oib.12; Mon, 22 Jul 2019 01:30:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=T4N0HhwGuXC3mqxfYtAKATut5jBkdVM9gFj5yRqL8TI=; b=PpOKQKjnDe7l8YzAv73SytoJ1KOpZRtzA5V7Hzu62N6+vzIzyo6aryjpPHgG+sna4v 5fleGwCHkFHogZkF/FbD6qrBUqxJnWq/Zhs+Psso3Lmqct0jOPmaix7BEzENlHH57Fn5 Sic1dyiuKI3zJR3DBJmvbaYoBSpgvWQJfR+THZ1abPGX70NPMKzjzSVmeNa0/tReZohW fsGP2lAg+tq/1Jnhoy+X+1+J5XoANDshFcW6WOu0/jG0bjA2lTnvX8kcBTu4/DxO8yju a6QoxqzccdhOoIds6I2ApTKnKS8DIUo4KnQwAGfQudLz/z+mZeH3HNYEpOmv7/DV+W8G ErmQ== X-Gm-Message-State: APjAAAUrhBc+AfwDtHcekcH/z/bzrmCR+2KLW7Ojl2fNbvoMVDn4hUXh +yGSSuESe/q+aOOSmf9x65XIUPnNOx/NMD02wfM= X-Google-Smtp-Source: APXvYqxI9yDO+N+DKAFeTYr3C1w2EDGzRVGNRik+xIOJXy8EkGVsjOe5Z6VKJyzTaTYdLzTJN3gfk8jLWQ47Wt64oQk= X-Received: by 2002:aca:cdd3:: with SMTP id d202mr30210012oig.115.1563784207998; Mon, 22 Jul 2019 01:30:07 -0700 (PDT) MIME-Version: 1.0 References: <20190722023530.67676-1-skunberg.kelsey@gmail.com> <20190722023530.67676-3-skunberg.kelsey@gmail.com> In-Reply-To: <20190722023530.67676-3-skunberg.kelsey@gmail.com> From: "Rafael J. Wysocki" Date: Mon, 22 Jul 2019 10:29:55 +0200 Message-ID: Subject: Re: [PATCH 2/3] ACPI: Remove acpi_has_method() call from scan.c To: Kelsey Skunberg Cc: "Rafael J. Wysocki" , Len Brown , ACPI Devel Maling List , Linux Kernel Mailing List , skhan@linuxfoundation.org, linux-kernel-mentees@lists.linuxfoundation.org, bjorn@helgaas.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 22, 2019 at 4:36 AM Kelsey Skunberg wrote: > > acpi_evaluate_reference() will return an error if the DEP method > does not exist. Checking if the DEP method exists before the > acpi_evaluate_reference() call is not needed. Remove acpi_has_method() > call to avoid additional work. > > Signed-off-by: Kelsey Skunberg > --- > drivers/acpi/scan.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c > index 0e28270b0fd8..4f2b0b481cee 100644 > --- a/drivers/acpi/scan.c > +++ b/drivers/acpi/scan.c > @@ -1803,9 +1803,6 @@ static void acpi_device_dep_initialize(struct acpi_device *adev) > > adev->dep_unmet = 0; > > - if (!acpi_has_method(adev->handle, "_DEP")) > - return; > - As you can see, this just returns. > status = acpi_evaluate_reference(adev->handle, "_DEP", NULL, > &dep_devices); > if (ACPI_FAILURE(status)) { Where this does something more on fallure. Therefore the code after the change is not equivalent to the code before it, so the changes is questionable.