lkml.org 
[lkml]   [2006]   [Aug]   [7]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateTue, 8 Aug 2006 01:22:12 +0200
FromPavel Machek <>
SubjectRe: [PATCH 02/12] hdaps: Use thinkpad_ec instead of direct port access
Hi!

> >> +#define ABORT_INIT(msg) { printk(KERN_ERR "hdaps init: %s\n", msg); > >goto bad; }> >> >No.. macro with embedded goto is *evil*.> > OK. But it does makes the init function much longer and harder to
>read.

If you keep { printk(); goto } on one line... it is technically
codingstyle violation but it is certainly better than evil macro.
> >> +     if (data.val[0xF]!=0x00)> >> +             ABORT_INIT("check1");> >> >!=0 in if is evil...> > Sure, when zero is special, like for booleans or integer or pointers.
> But this is a status byte value, I don't want to mistreat it just
> because all its bits are unset. Otherwise, imagine the non-systematic
> mess this will become:

Okay, I'd only do it in "single" cases. I guess you have point about
unsigned char not being boolean.
								Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-
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-08 01:25    [from the cache]
©2003-2008