lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 7 Aug 2006 18:40:23 +0300
From:	"Shem Multinymous" <multinymous@...il.com>
To:	"Pavel Machek" <pavel@...e.cz>
Cc:	"Robert Love" <rlove@...ve.org>,
	"Jean Delvare" <khali@...ux-fr.org>,
	"Greg Kroah-Hartman" <gregkh@...e.de>,
	"Alan Cox" <alan@...rguk.ukuu.org.uk>,
	linux-kernel@...r.kernel.org, hdaps-devel@...ts.sourceforge.net
Subject: Re: [PATCH 02/12] hdaps: Use thinkpad_ec instead of direct port access

On 8/7/06, Pavel Machek <pavel@...e.cz> wrote:
> > +#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 (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:

	if (data.val[0x1]!=0x00 ||
	    data.val[0x2]!=0x60 ||
	    data.val[0x3]!=0x00 ||
	    data.val[0xF]!=0x00)
		ABORT_INIT("check2");

> > +     if (mode==0x00)
>
> if !mode ?

Likewise.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ