Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp11175262ybi; Thu, 25 Jul 2019 11:16:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqzSZfPTIkJoqdHe/Mmx47+wnZj7gOngJkIFBzBK32O3yX0bxFNehKuxS7/FDSEwNPV7ftZM X-Received: by 2002:a17:90a:26a1:: with SMTP id m30mr95958075pje.59.1564078597050; Thu, 25 Jul 2019 11:16:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564078597; cv=none; d=google.com; s=arc-20160816; b=E79lkItCL4MPQGu9ykriDzzHxsKKicyYAahCIa+XY+ggpGm6Jtwts0bT8hKqhJYq+r HZIX/nHZWLIK17hmmeLSwJmNQzn+LuUyJoeQcB8NuegRwRaFn5cv6haRxSO4l1uSVjDE Ao/orHupSXwo/3mEYaj8zsUpgK4+QrF2yOX3K2ZUNsFf3r/NYfyR4XtWNG+gzgGoTFKf LkTrLpHPVXmIiETAeJWrvqP8VVkw0MRFZIcG0iX/VHy05OrphuH2XKK7byaxHpcH+vqI CZr6/SDQsjd7E1/eF2iVBQbDYncpTqhgaH+Mlf6CI7pdynPhDcX3J8afpB85+AenlJkR /5NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=EcbsdgPjPxknJYKkO+mmuPOpVmHnp8WiVb7FywqYwjg=; b=EQi+xydpZ53a39Nzv1r1Z65mXpbWyeOXXanxlNaWUIrCpIfeM7mUmPMQ3lgwk2TRn4 hSrlXP0r5DVU78e/BVKkvpUYu10cKYAYw+mwI5LwBvG9ZKI7QDaV4y/T2sFMgYD30+5+ VspvTHsUAwZIwTkDJ2/4Za3dDY2ifynCczZMyDBtqsdLv94jx4up4wqqzlDa2tFDwyFj gvOvY/KDPSkVTqGOTmgXllMX5c9XRwXjWJshyf4OdA75FRNDbbWQyEZtTkxgXPJO49pK uwcBfIVWz2rN4HsAoOQbJUEvWp0HQrq8rJBj9Ui96+Bwo6u5RkRFj30t76NYytIDFeRU jSHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pLWb8Ybf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s8si17659986pgq.538.2019.07.25.11.16.21; Thu, 25 Jul 2019 11:16:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pLWb8Ybf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728232AbfGYR6z (ORCPT + 99 others); Thu, 25 Jul 2019 13:58:55 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:37743 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726432AbfGYR6z (ORCPT ); Thu, 25 Jul 2019 13:58:55 -0400 Received: by mail-pf1-f196.google.com with SMTP id 19so23132334pfa.4; Thu, 25 Jul 2019 10:58:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EcbsdgPjPxknJYKkO+mmuPOpVmHnp8WiVb7FywqYwjg=; b=pLWb8Ybf6p6AINE/Tdedy/fPEWySwUCrqiOaullsWbXTwPvWJNDPUDuiLyuaeqdPl2 Tja42m2lpthvgCBUg3vB+siLXguL4TxbnQvCCa9JUzWh3IjkMSu78hir5+dxUQPURUch waYSuuhJ/1VaYy1MqDgFGdCeDkmf6BTEeQef/9/5cJCzYyBXYroUgocT5unH1zf/Y+ti m97wLUmcz9VC9bWK2EcJ7vDV6S2XFIpURzLpgx8xhKyka35NyR0vqts6PBf+Af/n0feU jNqcK035dt+IbCWfOPrmuhX57k+TNyHJKdqCXGFUe6tRVrwYocCmH5EUIiaB1o4tT9EF gouA== 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=EcbsdgPjPxknJYKkO+mmuPOpVmHnp8WiVb7FywqYwjg=; b=Ju/RS+OHVaXNh0mY15NFpIMs6o78ilK1YHkHCJ+RrJHYSBOJW+vjs2gjBKPf0IYMwh XUL/r/qC+14CuU/gbGsvWcj9qYXMdc3XMbeIwR7JTwJljxIJn0fpYJqnSgiUtwKeSsMI r7tlcUntuOwq0JGLtDbmAfT90yWSV+eRxULVkD8FmjRKigJ4VtR3o/c3+cxiUGYqyFMQ pg0FMpQL2v/cLYabY0IAcL2ZjbPW5PCzcgcMf9Ym6si+ZSyxevGzvyxq1xk5j+5biSla pctYkzSvtjoaalsBosN5/sSk+lg65nbLRMBstUi8PeVK+/QQNcFNhfes4Acj/NFsQ3bh ssXw== X-Gm-Message-State: APjAAAVSPhdDM6xl1eGgag7DFLUVkpGZ9aELrTVFPObGv8RXPfRkR8DZ 96tnth16SSRH0XKE0Z6xfxVY3B89i9NWGZ+sYZmAh1ky X-Received: by 2002:a63:e54f:: with SMTP id z15mr87139832pgj.4.1564077534693; Thu, 25 Jul 2019 10:58:54 -0700 (PDT) MIME-Version: 1.0 References: <20190722031158.70311-1-skunberg.kelsey@gmail.com> In-Reply-To: <20190722031158.70311-1-skunberg.kelsey@gmail.com> From: Andy Shevchenko Date: Thu, 25 Jul 2019 20:58:43 +0300 Message-ID: Subject: Re: [PATCH] platform: x86: Remove acpi_has_method() call in wmi.c To: Kelsey Skunberg Cc: Darren Hart , Andy Shevchenko , Platform Driver , Linux Kernel Mailing List , bjorn@helgaas.com, "Rafael J. Wysocki" , Shuah Khan , linux-kernel-mentees@lists.linuxfoundation.org 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 6:13 AM Kelsey Skunberg wrote: > > acpi_has_method() is unnecessary within __query_block() and should be > removed to avoid extra work. > > wc_status is initialized to AE_ERROR before the acpi_has_method() call. > acpi_has_method() and acpi_execute_simple_method() failing due to the > method not existing will result in the same outcome from __query_block(). > Pushed to my review and testing queue, thanks! > Signed-off-by: Kelsey Skunberg > --- > drivers/platform/x86/wmi.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c > index 784cea8572c2..59e9aa0f9643 100644 > --- a/drivers/platform/x86/wmi.c > +++ b/drivers/platform/x86/wmi.c > @@ -340,9 +340,7 @@ static acpi_status __query_block(struct wmi_block *wblock, u8 instance, > * expensive, but have no corresponding WCxx method. So we > * should not fail if this happens. > */ > - if (acpi_has_method(handle, wc_method)) > - wc_status = acpi_execute_simple_method(handle, > - wc_method, 1); > + wc_status = acpi_execute_simple_method(handle, wc_method, 1); > } > > strcpy(method, "WQ"); > -- > 2.20.1 > -- With Best Regards, Andy Shevchenko