Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1281794ybi; Wed, 17 Jul 2019 12:29:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqwgmxFqKjPzHI9w7LdvqCoTtjnUQLC+gngoxk7vADj7sme/UlPIr1poJXMV31sDi2e0mjjT X-Received: by 2002:a17:902:27e6:: with SMTP id i35mr45072572plg.190.1563391782207; Wed, 17 Jul 2019 12:29:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563391782; cv=none; d=google.com; s=arc-20160816; b=wJ2f2wcXIbM4oXvYG14Ir/rC/MRJIKd0gKdXowcqIB4Yx1FFkjPwDmQtzYb96sdbf8 mZKe8IVSvBN7Zra7adWwlgHNKP1Ple9vBF/fy43y+gy7kUKMNyb8j6KSgRhu+2n3gyVO O/RsJknWV8mqNEdIeOIDpAVUbJGrpa+GLP+GgrXPVmi3sxwXnIDvVAH7U1PSSGCLB5S7 aUcvGo3nwyc9XpWBS2yWayZog6KePec8k7rnsk79nQOJFoqgtlv4ofuXFOat61XY/Hlz G2duc7Io/psKBsOCc30YBDQoSJPaEImCPQ34mkB2Z1XwSgeLaPgiubAlCfbOlwp9WEYR iJNw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=WHgmdNdTahHJLMVtZuPGqZpMg+t7cvLI9kSEgTL6Hoc=; b=zxTAUZRyeykGMOimeAmXHZrzP2kRgYx294ZBiN/7z4oxMJWjJlwY06QQKWENxC1IDn Ngt1mxIZES96324ooESEzke12xglYrmecjTzw4F3me9y46rIsYuYAgsiZG1z1LpQPhZD zm4ZJkI0CXuVdnS5c4HA6QS6hKZleq91a2bj4FeyXZpNU0KQ4QQeIvPkXFoaWR0Pbw2l dQStgL5cuLLucL7+w4SxPGnNHlnH/PH4senkshJzNHzpfUUxAl2jpxF+jdsdE6Ni9JLZ nP9/F/UquWR0i0Ne71mNFVqUfdD19POk3k1YhRT5Stbd8hFRboF11TXyQxacZl4K9iP0 GDeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=C2Pmx6In; 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 w184si18573999pgd.394.2019.07.17.12.29.24; Wed, 17 Jul 2019 12:29:42 -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=C2Pmx6In; 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 S1727291AbfGQT2o (ORCPT + 99 others); Wed, 17 Jul 2019 15:28:44 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:43468 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726917AbfGQT2n (ORCPT ); Wed, 17 Jul 2019 15:28:43 -0400 Received: by mail-io1-f66.google.com with SMTP id k20so47571209ios.10; Wed, 17 Jul 2019 12:28:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=WHgmdNdTahHJLMVtZuPGqZpMg+t7cvLI9kSEgTL6Hoc=; b=C2Pmx6IniMXlfmCpO6ZSNlEZ/p7i68e11dMcX7VD9qbaYXTebPPCoMYa2c4xILK+MO 4sGJ27M43TBIzp6u+9MXQk3wputYlYjwPyzD89qF9CkNZvykAGp5kjUsnPILvL0bXLur el0YS578T+Zxp/4OeyXvOAFxuKgdMQrn3L3ZBcLsyU2Nx5AA0aQcm74uoQ92Co2wnjr1 yTjvEBLjtJycmc3i41aMqDCZvI6XhnOmQ2gUNGn28gNfv8jAf8BVN+CmGP7x+4qfPF+h K8zL4RDa50bW4D2pZksmMvSko1Ug7JcNt7YcUoZ+bPWClRw2djvQoARF1B/dxOG7N57n hmMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=WHgmdNdTahHJLMVtZuPGqZpMg+t7cvLI9kSEgTL6Hoc=; b=XPJsCrYPv9V0MjafztU/YhKFNOT46PREY4JOt9TlmArc5BNA9tyCW7kZeePXniSz8t bR+DHF7yIt4MG2bAeY4613OvKd9Ptq6KeBy8/AcR/RlL4aGcvlrD4LTARBzwV/RKJlHS Afe7RrpxRdRDPLZtYG8lp9tTIzzxUAm7zaJ2n9w0JBRFURwPIOgxxAQQCDFl/KZGMOV7 UKVHTQeGEY6gzX/qXapW28bfWRC9/4uDJiXllFgcAXltnDGHXL8EaMIhCgQO6/Z4+k5m fk3ui8d7ZAE7GRaIyfzrmh/QQqgdwxInUDfz//wDPBt0hFHF6sjqT0dxTkOQug+1AU56 6k8Q== X-Gm-Message-State: APjAAAVX4qH0gjUEroPSbPd7s8gjbCEG5yfGjwyqEPh9ZR+/VtKuezPt c7VY9RXja9vyj3FZevZljXs= X-Received: by 2002:a6b:f203:: with SMTP id q3mr39191375ioh.208.1563391723106; Wed, 17 Jul 2019 12:28:43 -0700 (PDT) Received: from localhost.localdomain (c-73-243-191-173.hsd1.co.comcast.net. [73.243.191.173]) by smtp.gmail.com with ESMTPSA id n7sm18927080ioo.79.2019.07.17.12.28.41 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 17 Jul 2019 12:28:41 -0700 (PDT) From: Kelsey Skunberg To: rui.zhang@intel.com, edubezval@gmail.com, daniel.lezcano@linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: skunberg.kelsey@gmail.com, bjorn@helgaas.com, skhan@linuxfoundation.org, linux-kernel-mentees@lists.linuxfoundation.org, rjw@rjwysocki.net Subject: [PATCH] thermal: intel: int340x_thermal: Remove unnecessary acpi_has_method() uses Date: Wed, 17 Jul 2019 13:26:39 -0600 Message-Id: <20190717192639.90092-1-skunberg.kelsey@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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; -- 2.20.1