All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Weiner <hannes@saeurebad.de>
To: kernel-janitors@vger.kernel.org
Subject: Re: getting rid of "fs_initcall" from drivers/ code
Date: Wed, 06 Aug 2008 07:30:33 +0000	[thread overview]
Message-ID: <8763qe4n3a.fsf@saeurebad.de> (raw)
In-Reply-To: <alpine.LFD.1.10.0808052206430.20743@localhost.localdomain>

Hi,

Matthew Wilcox <matthew@wil.cx> writes:

> On Tue, Aug 05, 2008 at 10:27:03PM -0400, Robert P. J. Day wrote:
>> ok ... what is the point of the following?
>> 
>> #ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE
>> fs_initcall(cpufreq_gov_userspace_init);
>> #else
>> module_init(cpufreq_gov_userspace_init);
>> #endif
>> 
>> and why can't it be reduced?
>
> That's a silly author. 

Sorry, my fault.

> The correct patch would look something like this:
>
> -#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE
>  fs_initcall(cpufreq_gov_userspace_init);
> -#else
> -module_init(cpufreq_gov_userspace_init);
> -#endif
>
> I couldn't tell you why this needs to be an fs_initcall rather than a
> plain module_init() (aka device_initcall()).  IMO every use of
> fs_initcall() in a module needs to document what ordering problem it's
> solving.

The cpu-specific driver used to call into the default governor before it
was initialized.

See 6915719b36a97d28fab576c6fa2a20364b435fe6.

Having a verbose ifdef with the config option, I hoped, would explain it
as in 'initialize the thing early if it is the default governor'.

But I agree that a plain fs_initcall() with a comment above it would be
perhaps less ugly.

	Hannes

  parent reply	other threads:[~2008-08-06  7:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-06  2:07 getting rid of "fs_initcall" from drivers/ code Robert P. J. Day
2008-08-06  2:25 ` Matthew Wilcox
2008-08-06  2:27 ` Robert P. J. Day
2008-08-06  2:47 ` Matthew Wilcox
2008-08-06  2:51 ` Robert P. J. Day
2008-08-06  7:30 ` Johannes Weiner [this message]
2008-08-06 10:02 ` Robert P. J. Day
2008-08-06 12:09 ` Matthew Wilcox
2008-08-06 13:54 ` Matthew Wilcox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8763qe4n3a.fsf@saeurebad.de \
    --to=hannes@saeurebad.de \
    --cc=kernel-janitors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.