public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Azael Avalos <coproscefalo@gmail.com>
To: Darren Hart <dvhart@infradead.org>,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: Azael Avalos <coproscefalo@gmail.com>
Subject: [PATCH] toshiba_acpi: Change some variables to avoid warnings the ninja-check script
Date: Wed, 22 Jul 2015 19:37:49 -0600	[thread overview]
Message-ID: <1437615474-27936-4-git-send-email-coproscefalo@gmail.com> (raw)
In-Reply-To: <1437615474-27936-1-git-send-email-coproscefalo@gmail.com>

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 <coproscefalo@gmail.com>
---
 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");
 	}
-- 
2.4.5


  parent reply	other threads:[~2015-07-23  1:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-23  1:37 [PATCH 1/1] toshiba_acpi: Reorder toshiba_acpi_alt_keymap entries Azael Avalos
2015-07-23  1:37 ` [PATCH 1/1] toshiba_acpi: Remove unused wireless defines Azael Avalos
2015-07-23  1:37 ` [PATCH 1/1] toshiba_acpi: Add set_fan_status function Azael Avalos
2015-07-24 22:45   ` Darren Hart
2015-07-24 23:40     ` Azael Avalos
2015-07-23  1:37 ` Azael Avalos [this message]
2015-07-23  1:37 ` [PATCH 0/4] toshiba_acpi: Refactor *{get, set} and *available functions Azael Avalos
2015-07-23  1:37 ` [PATCH 1/4] toshiba_acpi: Change *available functions return type Azael Avalos
2015-07-23  1:37 ` [PATCH 2/4] toshiba_acpi: Remove "*not supported" feature prints Azael Avalos
2015-07-23  1:37 ` [PATCH 3/4] toshiba_acpi: Refactor *{get, set} functions return value Azael Avalos
2015-07-23  1:37 ` [PATCH 4/4] toshiba_acpi: Bump driver version to 0.23 Azael Avalos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1437615474-27936-4-git-send-email-coproscefalo@gmail.com \
    --to=coproscefalo@gmail.com \
    --cc=dvhart@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox