From patchwork Thu Jul 23 01:37:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Azael Avalos X-Patchwork-Id: 6848851 Return-Path: X-Original-To: patchwork-platform-driver-x86@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5DFCC9F1D4 for ; Thu, 23 Jul 2015 01:39:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 77014206D4 for ; Thu, 23 Jul 2015 01:39:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 85B61206C5 for ; Thu, 23 Jul 2015 01:38:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753376AbbGWBiM (ORCPT ); Wed, 22 Jul 2015 21:38:12 -0400 Received: from mail-ob0-f177.google.com ([209.85.214.177]:34166 "EHLO mail-ob0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753393AbbGWBiG (ORCPT ); Wed, 22 Jul 2015 21:38:06 -0400 Received: by obre1 with SMTP id e1so145617017obr.1; Wed, 22 Jul 2015 18:38:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5zXHWmENF8DXE1fz03wgqzi2CgNk0faBuwilcw89ctE=; b=kAxwd8PwgSziL34npaKSGl3cgdFBXrtvJpMTOiX5F2hoS8OauKRhglRKNyHIZhHzZT EQTTXXadKgJrnGsyjxsUnCgSqI4NkCJN1vbA+BsaXfVAo5azm7j+uE20aby/V3zoZW7M xVuQv1tfLIwVbfPlIMdf77D0PcgxX1vFu+9aHedWRFGj7hqYPAHhfV2cAQYbbVzPFLdt fYEmsf8CXHvqjRq/cP4i1226lceuSmHveXwB5RJ7I4GACcmWwH8dIpgqAvW6jSt6+8sX EheKA8e2LGFgZ5etsH8NcWchBxbpTBDIq5Vl+4YZLUj6pA0D5y1ibEXxHN/e2yZQscwU z14Q== X-Received: by 10.202.98.193 with SMTP id w184mr5131692oib.96.1437615486050; Wed, 22 Jul 2015 18:38:06 -0700 (PDT) Received: from Shakuras.scurra.org (189.202.43.115.cable.dyn.cableonline.com.mx. [189.202.43.115]) by smtp.gmail.com with ESMTPSA id z19sm1960401obp.17.2015.07.22.18.38.04 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 22 Jul 2015 18:38:05 -0700 (PDT) From: Azael Avalos To: Darren Hart , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Azael Avalos Subject: [PATCH] toshiba_acpi: Change some variables to avoid warnings the ninja-check script Date: Wed, 22 Jul 2015 19:37:49 -0600 Message-Id: <1437615474-27936-4-git-send-email-coproscefalo@gmail.com> X-Mailer: git-send-email 2.4.5 In-Reply-To: <1437615474-27936-1-git-send-email-coproscefalo@gmail.com> References: <1437615474-27936-1-git-send-email-coproscefalo@gmail.com> Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch changes some variables to avoid warnins in the ninja-check script. We are basically moving some variables inside the conditionals were such variables are being used, and we are checking the returned values of some others. Signed-off-by: Azael Avalos --- drivers/platform/x86/toshiba_acpi.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c index 08fc867..32d6d16 100644 --- a/drivers/platform/x86/toshiba_acpi.c +++ b/drivers/platform/x86/toshiba_acpi.c @@ -1668,7 +1668,6 @@ static ssize_t kbd_backlight_mode_store(struct device *dev, { struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev); int mode; - int time; int ret; @@ -1699,7 +1698,7 @@ static ssize_t kbd_backlight_mode_store(struct device *dev, /* Only make a change if the actual mode has changed */ if (toshiba->kbd_mode != mode) { /* Shift the time to "base time" (0x3c0000 == 60 seconds) */ - time = toshiba->kbd_time << HCI_MISC_SHIFT; + int time = toshiba->kbd_time << HCI_MISC_SHIFT; /* OR the "base time" to the actual method format */ if (toshiba->kbd_type == 1) { @@ -2873,10 +2872,14 @@ static void toshiba_acpi_notify(struct acpi_device *acpi_dev, u32 event) static int toshiba_acpi_suspend(struct device *device) { struct toshiba_acpi_dev *dev = acpi_driver_data(to_acpi_device(device)); - u32 result; - if (dev->hotkey_dev) + if (dev->hotkey_dev) { + u32 result; + result = hci_write(dev, HCI_HOTKEY_EVENT, HCI_HOTKEY_DISABLE); + if (result != TOS_SUCCESS) + pr_info("Unable to disable hotkeys\n"); + } return 0; } @@ -2884,10 +2887,10 @@ static int toshiba_acpi_suspend(struct device *device) static int toshiba_acpi_resume(struct device *device) { struct toshiba_acpi_dev *dev = acpi_driver_data(to_acpi_device(device)); - int error; if (dev->hotkey_dev) { - error = toshiba_acpi_enable_hotkeys(dev); + int error = toshiba_acpi_enable_hotkeys(dev); + if (error) pr_info("Unable to re-enable hotkeys\n"); }