From owner-freebsd-hackers Tue Mar 5 22:36: 9 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from rover.village.org (rover.bsdimp.com [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id 7830D37B416; Tue, 5 Mar 2002 22:36:01 -0800 (PST) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.11.3/8.11.3) with ESMTP id g266a0i82121; Tue, 5 Mar 2002 23:36:00 -0700 (MST) (envelope-from imp@village.org) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.11.6/8.11.6) with ESMTP id g266ZxL82219; Tue, 5 Mar 2002 23:35:59 -0700 (MST) (envelope-from imp@village.org) Date: Tue, 05 Mar 2002 23:35:52 -0700 (MST) Message-Id: <20020305.233552.104015606.imp@village.org> To: obrien@FreeBSD.ORG Cc: keramida@FreeBSD.ORG, hackers@FreeBSD.ORG Subject: Re: RFC: style(9) isn't explicit about booleans for testing. From: "M. Warner Losh" In-Reply-To: <20020305164054.B38095@dragon.nuxi.com> References: <20020305155850.A38095@dragon.nuxi.com> <20020306000806.GC6839@hades.hell.gr> <20020305164054.B38095@dragon.nuxi.com> X-Mailer: Mew version 2.1 on Emacs 21.1 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message: <20020305164054.B38095@dragon.nuxi.com> "David O'Brien" writes: : On Wed, Mar 06, 2002 at 02:08:07AM +0200, Giorgos Keramidas wrote: : > On 2002-03-05 15:58, David O'Brien wrote: : > > On Tue, Mar 05, 2002 at 10:13:50PM +0200, Giorgos Keramidas wrote: : > > > > -Don't use '!' for tests unless it's a boolean, e.g. use : > > > > +For tests, always compare the value to the appropriate 0 instead of : > > > > +checking it directly, unless the value is a boolean. : > ... : > > : > > Please show examples from /sys that back up this change. To state this : > > explicitly, I think a significant number of /sys files should be : > > following it. : > : > Actually I was asking for comments, but anyways. : : I was giving one. :-) : style(9) documents the practices of /sys. Thus we should not arbitaryly : add rules w/o them being backed up in code. I believe that sys/pccard, sys/dev/{pccard,pcic,pccbb,cardbus} tends to follow this rule. If you are looking for examples. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message