Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1992960ybi; Thu, 18 Jul 2019 01:39:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqx9tKCunKrUauNXoep8sOsecbD0ODxNB/ynSHMj03V8x8xRNYLbSJyl55sJvCfyPheqOeVf X-Received: by 2002:a17:90a:3ae8:: with SMTP id b95mr48499867pjc.68.1563439179634; Thu, 18 Jul 2019 01:39:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563439179; cv=none; d=google.com; s=arc-20160816; b=T+Scvd7FZgQ3PzcpzKJpJ5qsS2QPbICSQPlewPHy+MsYvRRjFlbjDDxGgW5qn9sjil 1wN20PBWh+mc122V1sLMvHhAw8GpvIEGUkEUURb02dGT8HXycFhNtwBPM5mUdXR30gnD VvrOdIJw1zt0C4KCcOoMkxp8M71jDqPbj9xlGyrVqoCICKcclsyOEgkneUDTBM5TNGbu 5q8+kUSGLQqR8c3jcmt6fErQWfm++kc/sm+12bi+Jz/dlRNltaq41jtsdp4nbJNYpfmQ epA5Sn7G6+97T613rcLL8yT56x+iGKNymR0uQmZp8eIi1VBK25cRWO2nGQjR+DPv/ilp j2oA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=JT2nvmOGvhLM29WJ1mdlqyaYVkYihkf4Gh/YtfNLC0o=; b=n3hoPzpFexhW8lX/asIiWVO8pBult76aZbx72WvEYK01AGwYLgUYwoTOnMVH8HHdJS /FrjDrchMSc5U98fmmP+OhOpt9LWGdh8yl1QMfvo2VsEBIRH1LZDFGrqFgwxnPi+6+OA MsIZ4hup1btlE3IMkmwltRTO198ywypo7HqLQq1GYK99+DCWaCXNTl2WyyUkogR3Yvxs 5a/PHXwNUmDk131x6CY/m4ZUciz89hPL9iWL1Qrgrv0qzR7E14WHlrJTPcToHiqc9ssG /LnW9L8rjNP3g0TfSM6EA/I9Z9bcWua+V1ldlaaudbCxd/VBHZ8+k3ht1msmBXZ0sEMl 119Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 26si1899937pgs.520.2019.07.18.01.39.23; Thu, 18 Jul 2019 01:39:39 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389391AbfGRIhA (ORCPT + 99 others); Thu, 18 Jul 2019 04:37:00 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:45902 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726386AbfGRIhA (ORCPT ); Thu, 18 Jul 2019 04:37:00 -0400 Received: from 79.184.255.39.ipv4.supernova.orange.pl (79.184.255.39) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.267) id 15f044a4fc8d1e2f; Thu, 18 Jul 2019 10:36:57 +0200 From: "Rafael J. Wysocki" To: Kelsey Skunberg Cc: rui.zhang@intel.com, edubezval@gmail.com, daniel.lezcano@linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, bjorn@helgaas.com, skhan@linuxfoundation.org, linux-kernel-mentees@lists.linuxfoundation.org Subject: Re: [PATCH] thermal: intel: int340x_thermal: Remove unnecessary acpi_has_method() uses Date: Thu, 18 Jul 2019 10:36:57 +0200 Message-ID: <1780280.CEgozTfreW@kreacher> In-Reply-To: <20190717192639.90092-1-skunberg.kelsey@gmail.com> References: <20190717192639.90092-1-skunberg.kelsey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday, July 17, 2019 9:26:39 PM CEST Kelsey Skunberg wrote: > acpi_evaluate_object() will already return in error if the method does not > exist. Checking if the method is absent before the acpi_evaluate_object() > call is not needed. Remove acpi_has_method() calls to avoid additional > work. > > Signed-off-by: Kelsey Skunberg LGTM: Reviewed-by: Rafael J. Wysocki > --- > drivers/thermal/intel/int340x_thermal/acpi_thermal_rel.c | 6 ------ > 1 file changed, 6 deletions(-) > > diff --git a/drivers/thermal/intel/int340x_thermal/acpi_thermal_rel.c b/drivers/thermal/intel/int340x_thermal/acpi_thermal_rel.c > index 9716bc3abaf9..7130e90773ed 100644 > --- a/drivers/thermal/intel/int340x_thermal/acpi_thermal_rel.c > +++ b/drivers/thermal/intel/int340x_thermal/acpi_thermal_rel.c > @@ -77,9 +77,6 @@ int acpi_parse_trt(acpi_handle handle, int *trt_count, struct trt **trtp, > struct acpi_buffer element = { 0, NULL }; > struct acpi_buffer trt_format = { sizeof("RRNNNNNN"), "RRNNNNNN" }; > > - if (!acpi_has_method(handle, "_TRT")) > - return -ENODEV; > - > status = acpi_evaluate_object(handle, "_TRT", NULL, &buffer); > if (ACPI_FAILURE(status)) > return -ENODEV; > @@ -158,9 +155,6 @@ int acpi_parse_art(acpi_handle handle, int *art_count, struct art **artp, > struct acpi_buffer art_format = { > sizeof("RRNNNNNNNNNNN"), "RRNNNNNNNNNNN" }; > > - if (!acpi_has_method(handle, "_ART")) > - return -ENODEV; > - > status = acpi_evaluate_object(handle, "_ART", NULL, &buffer); > if (ACPI_FAILURE(status)) > return -ENODEV; >