lkml.org 
[lkml]   [2010]   [Oct]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 4/7] ARM: oprofile: Move non-ARM code into separate init/exit
On Wed, Oct 6, 2010 at 8:59 AM, Robert Richter <robert.richter@amd.com> wrote:
> On 06.10.10 10:53:11, Paul Mundt wrote:
>> On Wed, Oct 06, 2010 at 04:49:21PM +0200, Robert Richter wrote:
>> > On 06.10.10 15:33:09, Robert Richter wrote:
>> > > On 04.10.10 16:44:22, Matt Fleming wrote:
>> > > > -void __exit oprofile_arch_exit(void)
>> > > > +int __init oprofile_arch_init(struct oprofile_operations *ops)
>> > > > +{
>> > >
>> > > We should do here a:
>> > >
>> > >   memset(ops, 0, sizeof(*ops));
>> >
>> > Matt,
>> >
>> > an alternative would be to move this to oprofile_perf_init() and
>> > modify ops->backtrace afterwards, but then we will lose the function's
>> > tail call. Not sure that is better. Paul, what do you think?
>> >
>> I'm a bit confused as to why we just don't do:
>>
>> ---
>>
>> 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.

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

\
 
 \ /
  Last update: 2010-10-06 20:27    [from the cache]
©2003-2011 Jasper Spaans