From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
To: "Yu, Fenghua" <fenghua.yu@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Ingo Molnar <mingo@elte.hu>,
Rusty Russell <rusty@rustcorp.com.au>,
"Rafael J. Wysocki" <rjw@sisk.pl>,
linux-kernel <linux-kernel@vger.kernel.org>,
linux-pm <linux-pm@vger.kernel.org>,
linux-next <linux-next@vger.kernel.org>
Subject: Re: [PATCH] kernel/cpu.c: Add right qualifiers for intel_thermal_interrupt() and cpu_hotplug_pm_sync_init()
Date: Tue, 15 Nov 2011 11:28:03 +0530 [thread overview]
Message-ID: <4EC1FF6B.3050008@linux.vnet.ibm.com> (raw)
In-Reply-To: <493994B35A117E4F832F97C4719C4C0401EE048E46@orsmsx505.amr.corp.intel.com>
On 11/15/2011 05:32 AM, Yu, Fenghua wrote:
>>> -int cpu_hotplug_pm_sync_init(void)
>>> +static int __init cpu_hotplug_pm_sync_init(void)
>>> {
>>> pm_notifier(cpu_hotplug_pm_callback, 0);
>>
>> pm_notifier() macro will declare a static variable. I agree this won't
>> be any problem functionality-wise. But it doesn't seem elegant to say
>> "throw away the function but keep the static variable".
>> So, if you want to add __init qualifier to this function, I suggest
>> that
>> you declare the static variable outside the function, and call
>> register_pm_notifier() in the function, just to ensure it doesn't
>> obscure
>> things.
>>
> Rmoving __init cpu_hotplug_pm_sync_init() function after boot time and keep the static data defined in pm_notifier() is a normal behavior and normal usage in kernel. Same notifier registration usage function examples are ia64_mca_init() and msic_init() in mrst.c. There are quite a few other similar static data in __init functions usage examples in kernel source code.
>
> So I would keep the same code in the patch.
>
If that's a well-known practice and is not going to obscure anything,
then I am fine with your patch.
Thanks,
Srivatsa S. Bhat
> I'll send an updated patch just to change the title typo.
>
> Thanks.
>
> -Fenghua
>
next prev parent reply other threads:[~2011-11-15 6:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-10 20:22 [PATCH] kernel/cpu.c: Add right qualifiers for intel_thermal_interrupt() and cpu_hotplug_pm_sync_init() Fenghua Yu
2011-11-11 7:26 ` Srivatsa S. Bhat
2011-11-15 0:02 ` Yu, Fenghua
2011-11-15 5:58 ` Srivatsa S. Bhat [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-11-14 23:56 Fenghua Yu
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=4EC1FF6B.3050008@linux.vnet.ibm.com \
--to=srivatsa.bhat@linux.vnet.ibm.com \
--cc=fenghua.yu@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rjw@sisk.pl \
--cc=rusty@rustcorp.com.au \
--cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).