mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: "Alejandro Riveira Fernández" <ariveira@gmail.com>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Andrew Morton" <akpm@linux-foundation.org>
Subject: Re: Linux 2.6.26-rc5
Date: Thu, 5 Jun 2008 09:19:01 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.1.10.0806050917020.3473@woody.linux-foundation.org> (raw)
In-Reply-To: <200806051012.07457.bjorn.helgaas@hp.com>



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

  reply	other threads:[~2008-06-05 16:19 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-05  3:36 Linus Torvalds
2008-06-05 11:24 ` Olaf Hering
2008-06-05 12:09   ` Linux 2.6.26-rc5 (G5 SATA broken) Hugh Dickins
2008-06-05 12:54     ` Alan Cox
2008-06-05 13:44       ` [PATCH] libata: fix G5 SATA broken on -rc5 Hugh Dickins
2008-06-05 14:45         ` Olaf Hering
2008-06-06  4:36     ` Linux 2.6.26-rc5 (G5 SATA broken) Benjamin Herrenschmidt
2008-06-05 12:42   ` Linux 2.6.26-rc5 Alan Cox
2008-06-05 13:03 ` Alejandro Riveira Fernández
2008-06-05 14:54   ` Linus Torvalds
2008-06-05 15:12     ` Bjorn Helgaas
2008-06-05 16:12     ` Bjorn Helgaas
2008-06-05 16:19       ` Linus Torvalds [this message]
2008-06-05 16:32         ` Bjorn Helgaas
2008-06-05 14:43 ` Ben Dooks
2008-06-06 18:35   ` Linus Torvalds
2008-06-10 12:57     ` ACPI pull for 2.6.26? Adrian Bunk
2008-06-10 15:23       ` Len Brown
2008-06-10 15:39         ` Adrian Bunk
2008-06-05 14:47 ` Linux 2.6.26-rc5 Alex Romosan
2008-06-07 19:44 ` Jesper Krogh
2008-06-07 21:50   ` Frans Pop
2008-06-09  3:39     ` Bjorn Helgaas
2008-06-09 10:01       ` Frans Pop
2008-06-07 19:52 ` Jesper Krogh
2008-06-05 15:04 Lior Dotan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.1.10.0806050917020.3473@woody.linux-foundation.org \
    --to=torvalds@linux-foundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=ariveira@gmail.com \
    --cc=bjorn.helgaas@hp.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®