public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Miloslav Trmac <mitr@volny.cz>
To: Dmitry Torokhov <dtor_core@ameritech.net>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] wistron_btns: Fix missing BIOS signature handling, take 2
Date: Sun, 08 Jan 2006 08:52:26 +0100	[thread overview]
Message-ID: <43C0C4BA.8000800@volny.cz> (raw)
In-Reply-To: <200601080158.04175.dtor_core@ameritech.net>

[-- Attachment #1: Type: text/plain, Size: 342 bytes --]

Dmitry Torokhov wrote:
> On Sunday 08 January 2006 01:39, Miloslav Trmac wrote:
> 
>>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.
> 
> I don't really like that casting, should we just change offset to ssize_t?
Sure.
	Mirek

[-- Attachment #2: wistron-no-entry.patch --]
[-- Type: text/x-patch, Size: 925 bytes --]

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>

--- a/drivers/input/misc/wistron_btns.c	Sun Jan  8 06:30:59 2006
+++ b/drivers/input/misc/wistron_btns.c	Sun Jan  8 08:46:26 2006
@@ -92,11 +92,11 @@
 	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 int __init map_bios(void)
 {
 	void __iomem *base;
-	size_t offset;
+	ssize_t offset;
 	u32 entry_point;
 
 	base = ioremap(0xF0000, 0x10000); /* Can't fail */

  reply	other threads:[~2006-01-08  7:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-08  6:39 [PATCH] wistron_btns: Fix missing BIOS signature handling Miloslav Trmac
2006-01-08  6:58 ` Dmitry Torokhov
2006-01-08  7:52   ` Miloslav Trmac [this message]
2006-01-08 16:13     ` [PATCH] wistron_btns: Fix missing BIOS signature handling, take 2 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=43C0C4BA.8000800@volny.cz \
    --to=mitr@volny.cz \
    --cc=dtor_core@ameritech.net \
    --cc=linux-kernel@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