lkml.org 
[lkml]   [2006]   [Aug]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 02/12] hdaps: Use thinkpad_ec instead of direct port access
Hi!

Yes, this looks badly needed.

> As you can see from the comments at the beginning of the patch, the old
> driver got some stuff wrong about the meaning of EC readouts. This patch
> preserves the old broken behavior; it will be fixed in a later patch.
>
> Signed-off-by: Shem Multinymous <multinymous@gmail.com>

Signed-off-by: Pavel Machek <pavel@suse.cz>

> @@ -209,77 +131,79 @@ static int hdaps_read_pair(unsigned int
> * hdaps_device_init - initialize the accelerometer. Returns zero on success
> * and negative error code on failure. Can sleep.
> */
> +#define ABORT_INIT(msg) { printk(KERN_ERR "hdaps init: %s\n", msg); goto bad; }

No.. macro with embedded goto is *evil*.

> + if (thinkpad_ec_read_row(&args, &data))
> + ABORT_INIT("read1");
> + if (data.val[0xF]!=0x00)
> + ABORT_INIT("check1");

!=0 in if is evil...

> + mode = data.val[0x1];
> +
> + printk(KERN_DEBUG "hdaps: initial mode latch is 0x%02x\n", mode);
> + if (mode==0x00)

if !mode ?

Pavel

--
Thanks for all the (sleeping) penguins.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-08-07 16:17    [W:0.253 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site