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:	Thu, 21 Apr 2011 07:36:12 -0400
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Alan Cox <alan@...rguk.ukuu.org.uk>
Cc:	linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...e.hu>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	"H. Peter Anvin" <hpa@...or.com>,
	John Reiser <jreiser@...wagon.com>
Subject: Re: [RFC][PATCH 01/11] ftrace/trivial: Clean up recordmcount.c to
 use Linux style comparisons

On Thu, 2011-04-21 at 09:46 +0100, Alan Cox wrote:
> On Wed, 20 Apr 2011 22:28:26 -0400
> Steven Rostedt <rostedt@...dmis.org> wrote:
> 
> > From: Steven Rostedt <srostedt@...hat.com>
> > 
> > The Linux style for comparing is:
> > 
> >   var == 1
> >   var > 0
> 
> It's both and both forms are commonly used. I don't care what ftrace
> looks like but don't pedal bogus style. We have enough bogus style as it
> is.

I thought I read somewhere that this was the preferred method. But I
could be mistaking.

Anyway, the patch still stands, although I'll change the above line from
"Linux style" to "Linux ftrace style", as I'm the one that has to
maintain this code, and I prefer this method.

I translate: var == 1 as "var is one" so seeing "1 == var" my mind
translates that to "one is var" which just sounds funny. Every time I
see that notation I have to stop and think about it. I'm sure if I used
it enough that hesitation would vanish, but for now, I'll keep it as is.

I haven't done the "if (var = 1)" mistake since college.

-- Steve


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