From patchwork Mon Sep 19 01:33:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 9338395 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 383CD601C2 for ; Mon, 19 Sep 2016 01:34:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1DA5F28DD4 for ; Mon, 19 Sep 2016 01:34:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 11B5E28DDA; Mon, 19 Sep 2016 01:34:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6669328DD4 for ; Mon, 19 Sep 2016 01:34:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936003AbcISBeU (ORCPT ); Sun, 18 Sep 2016 21:34:20 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:33657 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932720AbcISBeT (ORCPT ); Sun, 18 Sep 2016 21:34:19 -0400 Received: by mail-pf0-f194.google.com with SMTP id q2so3779174pfj.0 for ; Sun, 18 Sep 2016 18:34:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ingics-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=hu1M5uFCg8ZG5warzotmg8lfm4h1oCwS2d3BOF4mAGg=; b=eY/PI08SUJlaS+m9eBAe1hMsfabr0HLdkzIv/hRZEfmPB/lovDe3v8tYcJvPu1mJeb QWiQiajUst9I5smzkoT8/8V06aKH5ygX2ANbOL4gnLw6f3oEo1wm8l9jH8/JRsXzhdJo P+2N79bjOVs+GU0co6ji6P2BR385jBT3Wu5pu9a2JsX5znxjcotRT93iEO9WngkqUTdr rd/zfcNvJzmxszMrkBhvgFdkoCSv3T7jP/C1Hr7XPIYPsdTSP50uVO1g+d3ZgnwnGQe8 lzsh+AIB67oJvV812vn6DEaSDq/L0bqJftrj+byXoQ9VkLsZ7uGcu1zfgwiCcQyeXB1I Xilg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=hu1M5uFCg8ZG5warzotmg8lfm4h1oCwS2d3BOF4mAGg=; b=CpqjoOUNlLBUTMKQwMNvbdDr2b9371flAkcvmA7sejSUhxmHJ7tRIACsAjB59Wc5oj HfQetdRpD7jAmQKt/wK80z7PreJrOw2KiKO6hzyew9qjJO13qREIWV9Kn6VhqU3qe1B9 SdVS9Zu+AZYcr4lhTIKHxmGae8I7uA+yqXPeRkSkgNOsZ51IyHUWP/L6QN4qKdfZTTcN LKk7l3L/a8s0nLr7Y0PZbfXI8ZUgDTZTwwxqBt4vPIGTMV9mZqy8Hq8h5hAEtowP8UtU SsaHh/9avBINsv1fvGF8X3/0+EVcIBKXBNngINvRELcBChva9i6ViPsFY8KZpbKnoz2G /h8A== X-Gm-Message-State: AE9vXwNyJL2xhMUv8fb+1j123h3G5k6bU02GTRpo50WNJbb/xnVYaMc5nSZZgEJtLnZS0Q== X-Received: by 10.98.3.67 with SMTP id 64mr42889543pfd.105.1474248858438; Sun, 18 Sep 2016 18:34:18 -0700 (PDT) Received: from localhost.localdomain (118-171-143-8.dynamic.hinet.net. [118.171.143.8]) by smtp.gmail.com with ESMTPSA id 81sm66635820pfm.90.2016.09.18.18.34.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 18 Sep 2016 18:34:17 -0700 (PDT) From: Axel Lin To: Darren Hart Cc: Alex Hung , AceLan Kao , Harald Welte , Henrique de Moraes Holschuh , platform-driver-x86@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, Axel Lin Subject: [PATCH] platform/x86: Use ACPI_FAILURE at appropriate places Date: Mon, 19 Sep 2016 09:33:51 +0800 Message-Id: <1474248831-29832-1-git-send-email-axel.lin@ingics.com> X-Mailer: git-send-email 2.7.4 Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use ACPI_FAILURE() to replace !ACPI_SUCCESS(), this avoid !! operations. Signed-off-by: Axel Lin Acked-by: Henrique de Moraes Holschuh Reviewed-by: Andy Shevchenko --- drivers/platform/x86/intel-hid.c | 6 +++--- drivers/platform/x86/intel-smartconnect.c | 2 +- drivers/platform/x86/intel-vbtn.c | 2 +- drivers/platform/x86/panasonic-laptop.c | 2 +- drivers/platform/x86/thinkpad_acpi.c | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/platform/x86/intel-hid.c b/drivers/platform/x86/intel-hid.c index ed58742..00cbeca 100644 --- a/drivers/platform/x86/intel-hid.c +++ b/drivers/platform/x86/intel-hid.c @@ -69,7 +69,7 @@ static int intel_hid_set_enable(struct device *device, int enable) arg0.integer.value = enable; status = acpi_evaluate_object(ACPI_HANDLE(device), "HDSM", &args, NULL); - if (!ACPI_SUCCESS(status)) { + if (ACPI_FAILURE(status)) { dev_warn(device, "failed to %sable hotkeys\n", enable ? "en" : "dis"); return -EIO; @@ -148,7 +148,7 @@ static void notify_handler(acpi_handle handle, u32 event, void *context) } status = acpi_evaluate_integer(handle, "HDEM", NULL, &ev_index); - if (!ACPI_SUCCESS(status)) { + if (ACPI_FAILURE(status)) { dev_warn(&device->dev, "failed to get event index\n"); return; } @@ -167,7 +167,7 @@ static int intel_hid_probe(struct platform_device *device) int err; status = acpi_evaluate_integer(handle, "HDMM", NULL, &mode); - if (!ACPI_SUCCESS(status)) { + if (ACPI_FAILURE(status)) { dev_warn(&device->dev, "failed to read mode\n"); return -ENODEV; } diff --git a/drivers/platform/x86/intel-smartconnect.c b/drivers/platform/x86/intel-smartconnect.c index 04cf5df..bbe4c06 100644 --- a/drivers/platform/x86/intel-smartconnect.c +++ b/drivers/platform/x86/intel-smartconnect.c @@ -29,7 +29,7 @@ static int smartconnect_acpi_init(struct acpi_device *acpi) acpi_status status; status = acpi_evaluate_integer(acpi->handle, "GAOS", NULL, &value); - if (!ACPI_SUCCESS(status)) + if (ACPI_FAILURE(status)) return -EINVAL; if (value & 0x1) { diff --git a/drivers/platform/x86/intel-vbtn.c b/drivers/platform/x86/intel-vbtn.c index 146d02f..f04a394 100644 --- a/drivers/platform/x86/intel-vbtn.c +++ b/drivers/platform/x86/intel-vbtn.c @@ -97,7 +97,7 @@ static int intel_vbtn_probe(struct platform_device *device) int err; status = acpi_evaluate_object(handle, "VBDL", NULL, NULL); - if (!ACPI_SUCCESS(status)) { + if (ACPI_FAILURE(status)) { dev_warn(&device->dev, "failed to read Intel Virtual Button driver\n"); return -ENODEV; } diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c index 3f87097..59b8eb6 100644 --- a/drivers/platform/x86/panasonic-laptop.c +++ b/drivers/platform/x86/panasonic-laptop.c @@ -458,7 +458,7 @@ static void acpi_pcc_generate_keyinput(struct pcc_acpi *pcc) rc = acpi_evaluate_integer(pcc->handle, METHOD_HKEY_QUERY, NULL, &result); - if (!ACPI_SUCCESS(rc)) { + if (ACPI_FAILURE(rc)) { ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "error getting hotkey status\n")); return; diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index b65ce75..31fb979 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -9018,7 +9018,7 @@ static int mute_led_on_off(struct tp_led_table *t, bool state) acpi_handle temp; int output; - if (!ACPI_SUCCESS(acpi_get_handle(hkey_handle, t->name, &temp))) { + if (ACPI_FAILURE(acpi_get_handle(hkey_handle, t->name, &temp))) { pr_warn("Thinkpad ACPI has no %s interface.\n", t->name); return -EIO; }