[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.1.10.0811241256370.32561@gandalf.stny.rr.com>
Date: Mon, 24 Nov 2008 13:00:36 -0500 (EST)
From: Steven Rostedt <rostedt@...dmis.org>
To: Paul Mackerras <paulus@...ba.org>
cc: linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...e.hu>,
Andrew Morton <akpm@...ux-foundation.org>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Thomas Gleixner <tglx@...utronix.de>, linuxppc-dev@...abs.org,
Milton Miller <miltonm@....com>,
Steven Rostedt <srostedt@...hat.com>
Subject: Re: [PATCH 2/5] powerpc: ftrace, convert to new dynamic ftrace arch
API
On Mon, 24 Nov 2008, Paul Mackerras wrote:
> Steven Rostedt writes:
>
> > Thanks to Paul Mackennas for pointing out the mistakes of my original
>
> Mackerras
Heh, I have two reasons for that typo.
1) I reference Paul McKenney a lot, and my fingers are programmed.
2) I type with the dvorak layout, and the 'r' is just above the 'n'.
qwerty 'o' == dvorak 'r'
qwerty 'l' == dvorak 'n'
;-)
>
> > +static int test_24bit_addr(unsigned long ip, unsigned long addr)
> > +{
> > + long diff;
> > +
> > + /*
> > + * Can we get to addr from ip in 24 bits?
> > + * (26 really, since we mulitply by 4 for 4 byte alignment)
> > + */
> > + diff = addr - ip;
> > +
> > + /*
> > + * Return true if diff is less than 1 << 25
> > + * and greater than -1 << 26.
> > + */
> > + return (diff < (1 << 25)) && (diff > (-1 << 26));
>
> I think this still isn't right, and the comment is one of those ones
> that is only useful to people who can't read C, as it's just a
> transliteration of the code.
Argh!!! That must be a misfold. I fixed that code. The final version
ad the same shift for both.
>
> The comment should say something like "Return true if diff can be
> represented as a 26-bit twos-complement binary number" and the second
> part of the test should be (diff >= (-1 << 25)). However, since you
> define a test_offset() function in patch 4/5 that does the same test
> but using only one comparison instead of two, why don't you just say:
>
> return !test_offset(diff);
>
> (having first moved test_offset() before test_24bit_addr)?
OK, will fix. Thanks. Hmm, maybe I ment to do that, and miss the patch :-/
-- 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