lkml.org 
[lkml]   [2008]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/5] ftrace: use code patching for ftrace graph tracer
On Wed, 26 Nov 2008 00:27:04 -0800 Harvey Harrison <harvey.harrison@gmail.com> wrote:

> if (code[0] != 0xe9 || old_offset != load32_noalign(&code[1]))
>
> This is similar to the new API in -mm load_le32_noalign, but I
> don't think it would be worth load_u32_noalign...load32 should
> be enough.
>
> > > > > + return -EINVAL;
> > > > > +
> > > > > + *(int *)(&code[1]) = new_offset;
> > > >
> > > > Might be able to use put_unaligned_foo() here.
> > > >
> > >
> > > put_unaligned(new_offset, (int *)(&code[1]));
> > >
>
> In a similar vein to above, this becomes:
>
> store32_noalign(&code[1], new_offset);
>

yes, that's much better than the party tricks with magical sizeof,
which forces you to run around and check the types of everything.

I've seen people doing get_user() on `long' types and such things
occasionally.



\
 
 \ /
  Last update: 2008-11-26 09:39    [W:0.672 / U:1.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site