public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dtor_core@ameritech.net>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Vojtech Pavlik <vojtech@suse.cz>,
	LKML <linux-kernel@vger.kernel.org>,
	Miloslav Trmac <mitr@volny.cz>
Subject: [PATCH 2/5] wistron: do not crash if BIOS does not support interface
Date: Tue, 10 Jan 2006 02:09:47 -0500	[thread overview]
Message-ID: <20060110071650.618082000.dtor_core@ameritech.net> (raw)
In-Reply-To: 20060110070945.912712000.dtor_core@ameritech.net

[-- Attachment #1: wistron-no-entry.patch --]
[-- Type: text/plain, Size: 1337 bytes --]

From: Miloslav Trmac <mitr@volny.cz>

Input: wistron - do not crash if BIOS does not support interface

offset can never be < 0 because it has type size_t.  The driver
currently oopses on insmod if BIOS does not support the interface,
instead of refusing to load.

Signed-off-by: Miloslav Trmac <mitr@volny.cz>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---

 drivers/input/misc/wistron_btns.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

Index: work/drivers/input/misc/wistron_btns.c
===================================================================
--- work.orig/drivers/input/misc/wistron_btns.c
+++ work/drivers/input/misc/wistron_btns.c
@@ -92,11 +92,11 @@ static void call_bios(struct regs *regs)
 	preempt_enable();
 }
 
-static size_t __init locate_wistron_bios(void __iomem *base)
+static ssize_t __init locate_wistron_bios(void __iomem *base)
 {
 	static const unsigned char __initdata signature[] =
 		{ 0x42, 0x21, 0x55, 0x30 };
-	size_t offset;
+	ssize_t offset;
 
 	for (offset = 0; offset < 0x10000; offset += 0x10) {
 		if (check_signature(base + offset, signature,
@@ -109,7 +109,7 @@ static size_t __init locate_wistron_bios
 static int __init map_bios(void)
 {
 	void __iomem *base;
-	size_t offset;
+	ssize_t offset;
 	u32 entry_point;
 
 	base = ioremap(0xF0000, 0x10000); /* Can't fail */


  parent reply	other threads:[~2006-01-10  7:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-10  7:09 [PATCH 0/5] Tiny input update for 2.6.15 Dmitry Torokhov
2006-01-10  7:09 ` [PATCH 1/5] grip_mp: small cleanup Dmitry Torokhov
2006-01-10  7:09 ` Dmitry Torokhov [this message]
2006-01-10  7:09 ` [PATCH 3/5] Input core: prepare for fops constness Dmitry Torokhov
2006-01-10  7:09 ` [PATCH 4/5] Remove obsolete maple input drivers Dmitry Torokhov
2006-01-10  7:09 ` [PATCH 5/5] ibmasm: fix input initialization error path Dmitry Torokhov

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=20060110071650.618082000.dtor_core@ameritech.net \
    --to=dtor_core@ameritech.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mitr@volny.cz \
    --cc=torvalds@osdl.org \
    --cc=vojtech@suse.cz \
    /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