Re: [PATCH 1/4] tracing/events: fix compile for modules disabled

Steven Rostedt
2009-04-15T16:27:47Z

On Wed, 15 Apr 2009, Frederic Weisbecker wrote:
> > +#else
> > +static int trace_module_notify(struct notifier_block *self,
> > + unsigned long val, void *data)
>
>
>
> I don't remember when you register the module notifier but
> I guess it is on init time, then you can set this func as __init
> if !CONFIG_MODULES.
>
>
> > +{
> > + return 0;
> > +}
> > +#endif /* CONFIG_MODULES */
> >
> > struct notifier_block trace_module_nb = {
> > .notifier_call = trace_module_notify,
>
>
> And then you can set this struct as __initdata_or_module, so
> that you can safely register this module notifier whatever
> config you have, and without consuming any space on the off case.

Good point. I'll update that.

-- Steve