[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20101006192235.GA13563@erda.amd.com>
Date: Wed, 6 Oct 2010 21:22:35 +0200
From: Robert Richter <robert.richter@....com>
To: Grant Likely <grant.likely@...retlab.ca>
CC: Paul Mundt <lethal@...ux-sh.org>,
Matt Fleming <matt@...sole-pimps.org>,
Will Deacon <will.deacon@....com>,
Russell King <linux@....linux.org.uk>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linux-sh@...r.kernel.org" <linux-sh@...r.kernel.org>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...e.hu>,
Frederic Weisbecker <fweisbec@...il.com>,
Arnaldo Carvalho de Melo <acme@...hat.com>,
"linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Deng-Cheng Zhu <dengcheng.zhu@...il.com>
Subject: Re: [PATCH 4/7] ARM: oprofile: Move non-ARM code into separate
init/exit
On 06.10.10 14:58:06, Grant Likely wrote:
> On Wed, Oct 6, 2010 at 12:44 PM, Robert Richter <robert.richter@....com> wrote:
> > On 06.10.10 14:23:17, Grant Likely wrote:
> >> >> diff --git a/drivers/oprofile/oprof.c b/drivers/oprofile/oprof.c
> >> >> index b336cd9..76d97a5 100644
> >> >> --- a/drivers/oprofile/oprof.c
> >> >> +++ b/drivers/oprofile/oprof.c
> >> >> @@ -252,6 +252,8 @@ static int __init oprofile_init(void)
> >> >> {
> >> >> int err;
> >> >>
> >> >> + memset(&oprofile_ops, 0, sizeof(struct oprofile_operations));
> >> >> +
> >> >
> >> > Yes, this looks much better. Thanks Paul.
> >>
> >> oprofile_ops is allocated in bss and so is already zeroed. No need to
> >> do it explicitly.
> >
> > Before oprofile_arch_init() it isn't necessarily needed, but we should
> > definitely add it before oprofile_timer_init(). For code readability I
> > would rather tend to let the first in too.
>
> ? Sorry, I don't understand what you're trying to say. Because
> oprofile_ops is statically allocated in bss; it will be zeroed before
> *any* of the init hooks is called.
The first call to oprofile_arch_init() might leave a dirty struct, but
as Paul just pointed out the function is aware of it and cleans up the
struct during init where necessary. The backtrace callback setup will
be reused if arch init fails (seems to be an ugly hack). So it is
better not to zero the struct then and keep everything unchanged.
-Robert
--
Advanced Micro Devices, Inc.
Operating System Research Center
--
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