diff mbox

parisc: don't use module_init for non-modular core pdc_cons code

Message ID 1390414784-6472-1-git-send-email-paul.gortmaker@windriver.com (mailing list archive)
State Awaiting Upstream
Headers show

Commit Message

Paul Gortmaker Jan. 22, 2014, 6:19 p.m. UTC
The pdc_cons.c code is always built in.  It will never be modular,
so using module_init as an alias for __initcall is rather
misleading.

Fix this up now, so that we can relocate module_init from
init.h into module.h in the future.  If we don't do this, we'd
have to add module.h to obviously non-modular code, and that
would be a worse thing.

Direct use of __initcall is discouraged, vs prioritized ones.
Use of device_initcall is consistent with what __initcall
maps onto, and hence does not change the init order, making the
impact of this change zero.   Should someone with real hardware
for boot testing want to change it later to arch_initcall or
something different, they can do that at a later date.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
Cc: Helge Deller <deller@gmx.de>
Cc: linux-parisc@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---

[patch will be added to init cleanup series:
   http://git.kernel.org/cgit/linux/kernel/git/paulg/init.git/  ]

 arch/parisc/kernel/pdc_cons.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

James Bottomley Jan. 22, 2014, 7:20 p.m. UTC | #1
On Wed, 2014-01-22 at 13:19 -0500, Paul Gortmaker wrote:
> The pdc_cons.c code is always built in.  It will never be modular,
> so using module_init as an alias for __initcall is rather
> misleading.
> 
> Fix this up now, so that we can relocate module_init from
> init.h into module.h in the future.  If we don't do this, we'd
> have to add module.h to obviously non-modular code, and that
> would be a worse thing.

I don't buy this.  We've already had an argument about using MODULE_
tags in non-modular code here:

http://marc.info/?t=138947344500007

The consensus was that we'd continue to do so, so that would seem to
invalidate the rationale for doing this patch set.

Without the rationale, this is churn for no gain, so I'd rather not do
it.

Thanks,

James


--
To unsubscribe from this list: send the line "unsubscribe linux-parisc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Paul Gortmaker Jan. 22, 2014, 7:33 p.m. UTC | #2
On 14-01-22 02:20 PM, James Bottomley wrote:
> On Wed, 2014-01-22 at 13:19 -0500, Paul Gortmaker wrote:
>> The pdc_cons.c code is always built in.  It will never be modular,
>> so using module_init as an alias for __initcall is rather
>> misleading.
>>
>> Fix this up now, so that we can relocate module_init from
>> init.h into module.h in the future.  If we don't do this, we'd
>> have to add module.h to obviously non-modular code, and that
>> would be a worse thing.
> 
> I don't buy this.  We've already had an argument about using MODULE_
> tags in non-modular code here:
> 
> http://marc.info/?t=138947344500007
> 
> The consensus was that we'd continue to do so, so that would seem to
> invalidate the rationale for doing this patch set.
> 
> Without the rationale, this is churn for no gain, so I'd rather not do
> it.

Hi James,

Thanks for the link.  Here is another one.

https://lkml.org/lkml/2014/1/21/434

In there I explain the rationale for doing this and what value add we
get from it.  Perhaps you'll say those things aren't important, and
then I guess we'll have to agree to disagree then... but I hope not.

Thanks,
Paul.
--

> 
> Thanks,
> 
> James
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
James Bottomley Jan. 22, 2014, 7:57 p.m. UTC | #3
On Wed, 2014-01-22 at 14:33 -0500, Paul Gortmaker wrote:
> On 14-01-22 02:20 PM, James Bottomley wrote:
> > On Wed, 2014-01-22 at 13:19 -0500, Paul Gortmaker wrote:
> >> The pdc_cons.c code is always built in.  It will never be modular,
> >> so using module_init as an alias for __initcall is rather
> >> misleading.
> >>
> >> Fix this up now, so that we can relocate module_init from
> >> init.h into module.h in the future.  If we don't do this, we'd
> >> have to add module.h to obviously non-modular code, and that
> >> would be a worse thing.
> > 
> > I don't buy this.  We've already had an argument about using MODULE_
> > tags in non-modular code here:
> > 
> > http://marc.info/?t=138947344500007
> > 
> > The consensus was that we'd continue to do so, so that would seem to
> > invalidate the rationale for doing this patch set.
> > 
> > Without the rationale, this is churn for no gain, so I'd rather not do
> > it.
> 
> Hi James,
> 
> Thanks for the link.  Here is another one.
> 
> https://lkml.org/lkml/2014/1/21/434
> 
> In there I explain the rationale for doing this and what value add we
> get from it.  Perhaps you'll say those things aren't important, and
> then I guess we'll have to agree to disagree then... but I hope not.

Well, OK, so 1 is covered by the link I sent.  3 is an EDONTCARE because
we don't care when the console is initialised as long as it is. Your
reason 2 I'm not sure I understand.  module_exit() functions are
automatically discarded by the linker scripts ... if we have a problem
with reference to code in them it will cause a link failure.

I'm grateful for dumping all the spurious section mismatches caused by
HOTPLUG, I really am, but I'm seeing less benefit to this code churn.

James


--
To unsubscribe from this list: send the line "unsubscribe linux-parisc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/parisc/kernel/pdc_cons.c b/arch/parisc/kernel/pdc_cons.c
index d5cae55195ec..10a5ae9553fd 100644
--- a/arch/parisc/kernel/pdc_cons.c
+++ b/arch/parisc/kernel/pdc_cons.c
@@ -207,8 +207,7 @@  static int __init pdc_console_tty_driver_init(void)
 
 	return 0;
 }
-
-module_init(pdc_console_tty_driver_init);
+device_initcall(pdc_console_tty_driver_init);
 
 static struct tty_driver * pdc_console_device (struct console *c, int *index)
 {