Re: + clocksource-driver-initialize-list-value.patch added to -mm tree

Andrew Morton
2007-04-04T20:49:12Z

On Wed, 4 Apr 2007 22:36:47 +0200
Ingo Molnar <mingo@elte.hu> wrote:

>
> * Daniel Walker <dwalker@mvista.com> wrote:
>
> > The struct clocksource .list field is now required to be initialized
> > before calling clocksource_register().
> >
> > This is a prerequisite for simplifying the clocksource registration
> > process.
>
> why?

It's all enablement for
ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.21-rc5/2.6.21-rc5-mm4/broken-out/clocksource-refactor-duplicate-registration-checking.patch,
on which I have no opinion.

> This patch only pushes some unnecessary code into the clocksource
> drivers:
>
> + .list = LIST_HEAD_INIT(clocksource_avr32.list),
>
> NACK unless you can give an explanation of why this is unavoidable. A
> NULL initializer is just as good as an initialized list entry. (in fact
> it's slightly better because it's in the kernel's BSS)
>

No, these structures are already in .data.

.mask = CLOCKSOURCE_MASK(32),
.mult = 0,
.shift = 20,
+ .list = LIST_HEAD_INIT(clocksource_pit.list),
};