Re: [PATCH 2/2] powerpc, ftrace: use create_branch lib function

From: Steven Rostedt
Date: Sat Feb 14 2009 - 10:20:52 EST




On Sun, 15 Feb 2009, Michael Ellerman wrote:
> >
> > /* if (link) set op to 'bl' else 'b' */
> > - op = 0x48000000 | (link ? 1 : 0);
> > - op |= (ftrace_calc_offset(ip, addr) & 0x03fffffc);
> > + op = create_branch((unsigned int *)ip, addr, link ? 1 : 0);
>
> If I was feeling nit-picky I'd say you should use:
>
> op = create_branch((unsigned int *)ip, addr, link ? BRANCH_SET_LINK : 0);
>
>
> But admittedly we're unlikely to ever change the flag handling, so it's
> probably not worth the effort of a respin (or this email :).

Not worth the effort of a respin, I agree.

But it would be worth the effort of a clean up patch ;-)

Not for "oh this flag might change", but for reviewers looking at the
code and knowing exactly what that '1' means.

-- Steve

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/