[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1227722760.5511.75.camel@brick>
Date: Wed, 26 Nov 2008 10:06:00 -0800
From: Harvey Harrison <harvey.harrison@...il.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Steven Rostedt <rostedt@...dmis.org>, linux-kernel@...r.kernel.org,
Ingo Molnar <mingo@...e.hu>,
Frederic Weisbecker <fweisbec@...il.com>,
containers@...ts.osdl.org,
Sukadev Bhattiprolu <sukadev@...ux.vnet.ibm.com>,
"Serge E. Hallyn" <serue@...ibm.com>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Steven Rostedt <srostedt@...hat.com>
Subject: Re: [PATCH 2/5] ftrace: use code patching for ftrace graph tracer
On Wed, 2008-11-26 at 10:02 -0800, Andrew Morton wrote:
> > >
> > > > + return -EINVAL;
> > > > +
> > > > + *(int *)(&code[1]) = new_offset;
> > >
> > > Might be able to use put_unaligned_foo() here.
> > >
> > > The problem is that these functions use sizeof(*ptr) to work out what
> > > to do, so a cast is still needed. A get_unaligned32(ptr) would be
> > > nice. One which takes a void* and assumes CPU ordering.
> >
> > Is there a correctness concern here? This is arch specific code, so I'm
> > not worried about other archs.
>
> No, the code is OK as-is.
>
> It's just that "read a word from an [maybe-]unaligned address" is such
> a common operation that there should be a nice clean simple function to
> do it, rather than doing open-coded (and different) weird C tricks at each
> and\ every site.
>
Also it is arch-specific, so if you know unaligned access is OK, just doing the
cast+deref is OK.
Harvey
--
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