X86 platform drivers
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Henrique de Moraes Holschuh <ibm-acpi@hmh.eng.br>,
	Bastien Nocera <hadess@hadess.net>
Cc: Darren Hart <dvhart@infradead.org>,
	ibm-acpi-devel@lists.sourceforge.net,
	platform-driver-x86@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: [patch 1/2] thinkpad_acpi: signedness bugs getting current_mode
Date: Wed, 11 Mar 2015 12:34:50 +0300	[thread overview]
Message-ID: <20150311093450.GA3564@mwanda> (raw)

This needs to be signed for the error handling to work.  Valid modes are
small positive integers.

Fixes: b790ceeb0fd9 ('thinkpad_acpi: Add adaptive_kbd_mode sysfs attr')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 56eaddc..024861d 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -2938,7 +2938,7 @@ static ssize_t adaptive_kbd_mode_show(struct device *dev,
 			   struct device_attribute *attr,
 			   char *buf)
 {
-	u32 current_mode;
+	int current_mode;
 
 	current_mode = adaptive_keyboard_get_mode();
 	if (current_mode < 0)
@@ -3621,7 +3621,7 @@ static int adaptive_keyboard_get_next_mode(int mode)
 
 static bool adaptive_keyboard_hotkey_notify_hotkey(unsigned int scancode)
 {
-	u32 current_mode = 0;
+	int current_mode = 0;
 	int new_mode = 0;
 	int keycode;
 

             reply	other threads:[~2015-03-11  9:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-11  9:34 Dan Carpenter [this message]
2015-03-11 10:07 ` [patch 1/2] thinkpad_acpi: signedness bugs getting current_mode Bastien Nocera
2015-03-11 10:28 ` Henrique de Moraes Holschuh
2015-03-14 19:03 ` Darren Hart
2015-03-14 21:06 ` Darren Hart
2015-03-15  2:46   ` Stephen Rothwell
2015-03-15  2:48     ` Stephen Rothwell
2015-03-19  3:42       ` Darren Hart
2015-03-22 18:58 ` [ibm-acpi-devel] " Henrique de Moraes Holschuh

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=20150311093450.GA3564@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=dvhart@infradead.org \
    --cc=hadess@hadess.net \
    --cc=ibm-acpi-devel@lists.sourceforge.net \
    --cc=ibm-acpi@hmh.eng.br \
    --cc=kernel-janitors@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