lkml.org 
[lkml]   [2011]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC][PATCH 01/11] ftrace/trivial: Clean up recordmcount.c to use Linux style comparisons
From
Date
On Thu, 2011-04-21 at 09:46 +0100, Alan Cox wrote:
> On Wed, 20 Apr 2011 22:28:26 -0400
> Steven Rostedt <rostedt@goodmis.org> wrote:
>
> > From: Steven Rostedt <srostedt@redhat.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




\
 
 \ /
  Last update: 2011-04-21 13:39    [W:0.098 / U:0.556 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site