lkml.org 
[lkml]   [2006]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] wistron_btns: Fix missing BIOS signature handling, take 2
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
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 */
\
 
 \ /
  Last update: 2006-01-08 08:55    [W:0.066 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site