Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760831AbYFEQT1 (ORCPT ); Thu, 5 Jun 2008 12:19:27 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756326AbYFEQTM (ORCPT ); Thu, 5 Jun 2008 12:19:12 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:49947 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760733AbYFEQTL (ORCPT ); Thu, 5 Jun 2008 12:19:11 -0400 Date: Thu, 5 Jun 2008 09:19:01 -0700 (PDT) From: Linus Torvalds To: Bjorn Helgaas cc: =?ISO-8859-15?Q?Alejandro_Riveira_Fern=E1ndez?= , Linux Kernel Mailing List , Andrew Morton Subject: Re: Linux 2.6.26-rc5 In-Reply-To: <200806051012.07457.bjorn.helgaas@hp.com> Message-ID: References: <20080605150306.18c00bd9@Varda> <200806051012.07457.bjorn.helgaas@hp.com> User-Agent: Alpine 1.10 (LFD 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 958 Lines: 29 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/