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]
Message-ID: <alpine.LFD.1.10.0806050917020.3473@woody.linux-foundation.org>
Date:	Thu, 5 Jun 2008 09:19:01 -0700 (PDT)
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	Bjorn Helgaas <bjorn.helgaas@...com>
cc:	Alejandro Riveira Fernández 
	<ariveira@...il.com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: Linux 2.6.26-rc5



On Thu, 5 Jun 2008, Bjorn Helgaas wrote:
>  
>  	for (i = 0; (res = pnp_get_resource(dev, IORESOURCE_MEM, i)); i++) {
> -		if (res->flags & IORESOURCE_DISABLED)
> +		if (res->flags & IORESOURCE_UNSET ||
> +		    res->flags & IORESOURCE_DISABLED)
>  			continue;

Umm. If I was a compiler, I'd be warning about this. You don't get a 
warning about suggesting parentheses around the '&'?

Also, regardless of lack of warnings, the natural way to do this is to 
just say

	if (res->flags & (IORESOURCE_DISABLED | IORESOURCE_UNSET))
		continue;

which is what any sane compiler would rewrite it to anyway, but since it's 
not just more readable for computers, but for humans too, why not do it 
that way?

			Linus
--
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