linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [patch 3/4] macintosh: replace deprecated __initcall with device_initcall
@ 2008-05-14 23:12 akpm
  2008-05-15  4:14 ` Paul Mackerras
  0 siblings, 1 reply; 7+ messages in thread
From: akpm @ 2008-05-14 23:12 UTC (permalink / raw)
  To: paulus; +Cc: linuxppc-dev, akpm, rpjday

From: "Robert P. J. Day" <rpjday@crashcourse.ca>

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/macintosh/adb.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/macintosh/adb.c~macintosh-replace-deprecated-__initcall-with-device_initcall drivers/macintosh/adb.c
--- a/drivers/macintosh/adb.c~macintosh-replace-deprecated-__initcall-with-device_initcall
+++ a/drivers/macintosh/adb.c
@@ -334,7 +334,7 @@ int __init adb_init(void)
 	return 0;
 }
 
-__initcall(adb_init);
+device_initcall(adb_init);
 
 static int
 do_adb_reset_bus(void)
_

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [patch 3/4] macintosh: replace deprecated __initcall with device_initcall
  2008-05-14 23:12 [patch 3/4] macintosh: replace deprecated __initcall with device_initcall akpm
@ 2008-05-15  4:14 ` Paul Mackerras
  2008-05-15  6:06   ` Andrew Morton
  0 siblings, 1 reply; 7+ messages in thread
From: Paul Mackerras @ 2008-05-15  4:14 UTC (permalink / raw)
  To: akpm; +Cc: linuxppc-dev, rpjday

akpm@linux-foundation.org writes:

> -__initcall(adb_init);
> +device_initcall(adb_init);

There's no particular reason why this needs to go in 2.6.26, is there?
It looks to me like something that I should queue up for 2.6.27.

Paul.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [patch 3/4] macintosh: replace deprecated __initcall with device_initcall
  2008-05-15  4:14 ` Paul Mackerras
@ 2008-05-15  6:06   ` Andrew Morton
  2008-05-15  6:28     ` Michael Ellerman
  0 siblings, 1 reply; 7+ messages in thread
From: Andrew Morton @ 2008-05-15  6:06 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev, rpjday

On Thu, 15 May 2008 14:14:38 +1000 Paul Mackerras <paulus@samba.org> wrote:

> akpm@linux-foundation.org writes:
> 
> > -__initcall(adb_init);
> > +device_initcall(adb_init);
> 
> There's no particular reason why this needs to go in 2.6.26, is there?
> It looks to me like something that I should queue up for 2.6.27.
> 

No, this make no difference in code generation - it's just a
use-the-modern-interface thing.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [patch 3/4] macintosh: replace deprecated __initcall with device_initcall
  2008-05-15  6:06   ` Andrew Morton
@ 2008-05-15  6:28     ` Michael Ellerman
  2008-05-15  6:41       ` Andrew Morton
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Ellerman @ 2008-05-15  6:28 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linuxppc-dev, rpjday, Paul Mackerras

[-- Attachment #1: Type: text/plain, Size: 881 bytes --]

On Wed, 2008-05-14 at 23:06 -0700, Andrew Morton wrote:
> On Thu, 15 May 2008 14:14:38 +1000 Paul Mackerras <paulus@samba.org> wrote:
> 
> > akpm@linux-foundation.org writes:
> > 
> > > -__initcall(adb_init);
> > > +device_initcall(adb_init);
> > 
> > There's no particular reason why this needs to go in 2.6.26, is there?
> > It looks to me like something that I should queue up for 2.6.27.
> > 
> 
> No, this make no difference in code generation - it's just a
> use-the-modern-interface thing.

I missed the memo about __initcall being deprecated, or is it only
deprecated for use in device drivers?

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [patch 3/4] macintosh: replace deprecated __initcall with device_initcall
  2008-05-15  6:28     ` Michael Ellerman
@ 2008-05-15  6:41       ` Andrew Morton
  2008-05-15  9:08         ` Michael Ellerman
  0 siblings, 1 reply; 7+ messages in thread
From: Andrew Morton @ 2008-05-15  6:41 UTC (permalink / raw)
  To: michael; +Cc: linuxppc-dev, rpjday, Paul Mackerras

On Thu, 15 May 2008 16:28:28 +1000 Michael Ellerman <michael@ellerman.id.au> wrote:

> On Wed, 2008-05-14 at 23:06 -0700, Andrew Morton wrote:
> > On Thu, 15 May 2008 14:14:38 +1000 Paul Mackerras <paulus@samba.org> wrote:
> > 
> > > akpm@linux-foundation.org writes:
> > > 
> > > > -__initcall(adb_init);
> > > > +device_initcall(adb_init);
> > > 
> > > There's no particular reason why this needs to go in 2.6.26, is there?
> > > It looks to me like something that I should queue up for 2.6.27.
> > > 
> > 
> > No, this make no difference in code generation - it's just a
> > use-the-modern-interface thing.
> 
> I missed the memo about __initcall being deprecated, or is it only
> deprecated for use in device drivers?
> 

It's just old-fashioned, that's all.

#define pure_initcall(fn)		__define_initcall("0",fn,0)

#define core_initcall(fn)		__define_initcall("1",fn,1)
#define core_initcall_sync(fn)		__define_initcall("1s",fn,1s)
#define postcore_initcall(fn)		__define_initcall("2",fn,2)
#define postcore_initcall_sync(fn)	__define_initcall("2s",fn,2s)
#define arch_initcall(fn)		__define_initcall("3",fn,3)
#define arch_initcall_sync(fn)		__define_initcall("3s",fn,3s)
#define subsys_initcall(fn)		__define_initcall("4",fn,4)
#define subsys_initcall_sync(fn)	__define_initcall("4s",fn,4s)
#define fs_initcall(fn)			__define_initcall("5",fn,5)
#define fs_initcall_sync(fn)		__define_initcall("5s",fn,5s)
#define rootfs_initcall(fn)		__define_initcall("rootfs",fn,rootfs)
#define device_initcall(fn)		__define_initcall("6",fn,6)
#define device_initcall_sync(fn)	__define_initcall("6s",fn,6s)
#define late_initcall(fn)		__define_initcall("7",fn,7)
#define late_initcall_sync(fn)		__define_initcall("7s",fn,7s)

#define __initcall(fn) device_initcall(fn)

See, we have the nicely-ordered foo_initcall()'s, and the old-fashioned
legacy __initcall happens to map onto device_initcall().

Such code should use device_initcall() directly.  So we see at which
stage in initcalls this function will be called.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [patch 3/4] macintosh: replace deprecated __initcall with device_initcall
  2008-05-15  6:41       ` Andrew Morton
@ 2008-05-15  9:08         ` Michael Ellerman
  2008-05-15 17:43           ` Andrew Morton
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Ellerman @ 2008-05-15  9:08 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linuxppc-dev, rpjday, Paul Mackerras

[-- Attachment #1: Type: text/plain, Size: 2996 bytes --]

On Wed, 2008-05-14 at 23:41 -0700, Andrew Morton wrote:
> On Thu, 15 May 2008 16:28:28 +1000 Michael Ellerman <michael@ellerman.id.au> wrote:
> 
> > On Wed, 2008-05-14 at 23:06 -0700, Andrew Morton wrote:
> > > On Thu, 15 May 2008 14:14:38 +1000 Paul Mackerras <paulus@samba.org> wrote:
> > > 
> > > > akpm@linux-foundation.org writes:
> > > > 
> > > > > -__initcall(adb_init);
> > > > > +device_initcall(adb_init);
> > > > 
> > > > There's no particular reason why this needs to go in 2.6.26, is there?
> > > > It looks to me like something that I should queue up for 2.6.27.
> > > > 
> > > 
> > > No, this make no difference in code generation - it's just a
> > > use-the-modern-interface thing.
> > 
> > I missed the memo about __initcall being deprecated, or is it only
> > deprecated for use in device drivers?
> > 
> 
> It's just old-fashioned, that's all.
>
> #define pure_initcall(fn)		__define_initcall("0",fn,0)
> 
> #define core_initcall(fn)		__define_initcall("1",fn,1)
> #define core_initcall_sync(fn)		__define_initcall("1s",fn,1s)
> #define postcore_initcall(fn)		__define_initcall("2",fn,2)
> #define postcore_initcall_sync(fn)	__define_initcall("2s",fn,2s)
> #define arch_initcall(fn)		__define_initcall("3",fn,3)
> #define arch_initcall_sync(fn)		__define_initcall("3s",fn,3s)
> #define subsys_initcall(fn)		__define_initcall("4",fn,4)
> #define subsys_initcall_sync(fn)	__define_initcall("4s",fn,4s)
> #define fs_initcall(fn)			__define_initcall("5",fn,5)
> #define fs_initcall_sync(fn)		__define_initcall("5s",fn,5s)
> #define rootfs_initcall(fn)		__define_initcall("rootfs",fn,rootfs)
> #define device_initcall(fn)		__define_initcall("6",fn,6)
> #define device_initcall_sync(fn)	__define_initcall("6s",fn,6s)
> #define late_initcall(fn)		__define_initcall("7",fn,7)
> #define late_initcall_sync(fn)		__define_initcall("7s",fn,7s)
> 
> #define __initcall(fn) device_initcall(fn)
> 
> See, we have the nicely-ordered foo_initcall()'s, and the old-fashioned
> legacy __initcall happens to map onto device_initcall().
> 
> Such code should use device_initcall() directly.  So we see at which
> stage in initcalls this function will be called.

Yeah fair enough. 

A little git'ing tells me there were 31 new __initcall()'s added between
2.6.24 and 2.6.25, and there are 12 more lurking between 2.6.25 and
linux-next. They're breeding!

You can't stick a #warning inside a #define can you? How about:

#define __initcall(fn)				\
do {						\
int Use_device_initcall_not___initcall_please;	\
device_initcall(fn);				\
} while (0)

Which gives:
warning: unused variable ‘Use_device_initcall_not___initcall_please’

..

Yeah OK that was a joke.

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [patch 3/4] macintosh: replace deprecated __initcall with device_initcall
  2008-05-15  9:08         ` Michael Ellerman
@ 2008-05-15 17:43           ` Andrew Morton
  0 siblings, 0 replies; 7+ messages in thread
From: Andrew Morton @ 2008-05-15 17:43 UTC (permalink / raw)
  To: michael; +Cc: linuxppc-dev, rpjday, Paul Mackerras

On Thu, 15 May 2008 19:08:37 +1000 Michael Ellerman <michael@ellerman.id.au> wrote:

> On Wed, 2008-05-14 at 23:41 -0700, Andrew Morton wrote:
> > On Thu, 15 May 2008 16:28:28 +1000 Michael Ellerman <michael@ellerman.id.au> wrote:
> > 
> > > On Wed, 2008-05-14 at 23:06 -0700, Andrew Morton wrote:
> > > > On Thu, 15 May 2008 14:14:38 +1000 Paul Mackerras <paulus@samba.org> wrote:
> > > > 
> > > > > akpm@linux-foundation.org writes:
> > > > > 
> > > > > > -__initcall(adb_init);
> > > > > > +device_initcall(adb_init);
> > > > > 
> > > > > There's no particular reason why this needs to go in 2.6.26, is there?
> > > > > It looks to me like something that I should queue up for 2.6.27.
> > > > > 
> > > > 
> > > > No, this make no difference in code generation - it's just a
> > > > use-the-modern-interface thing.
> > > 
> > > I missed the memo about __initcall being deprecated, or is it only
> > > deprecated for use in device drivers?
> > > 
> > 
> > It's just old-fashioned, that's all.
> >
> > #define pure_initcall(fn)		__define_initcall("0",fn,0)
> > 
> > #define core_initcall(fn)		__define_initcall("1",fn,1)
> > #define core_initcall_sync(fn)		__define_initcall("1s",fn,1s)
> > #define postcore_initcall(fn)		__define_initcall("2",fn,2)
> > #define postcore_initcall_sync(fn)	__define_initcall("2s",fn,2s)
> > #define arch_initcall(fn)		__define_initcall("3",fn,3)
> > #define arch_initcall_sync(fn)		__define_initcall("3s",fn,3s)
> > #define subsys_initcall(fn)		__define_initcall("4",fn,4)
> > #define subsys_initcall_sync(fn)	__define_initcall("4s",fn,4s)
> > #define fs_initcall(fn)			__define_initcall("5",fn,5)
> > #define fs_initcall_sync(fn)		__define_initcall("5s",fn,5s)
> > #define rootfs_initcall(fn)		__define_initcall("rootfs",fn,rootfs)
> > #define device_initcall(fn)		__define_initcall("6",fn,6)
> > #define device_initcall_sync(fn)	__define_initcall("6s",fn,6s)
> > #define late_initcall(fn)		__define_initcall("7",fn,7)
> > #define late_initcall_sync(fn)		__define_initcall("7s",fn,7s)
> > 
> > #define __initcall(fn) device_initcall(fn)
> > 
> > See, we have the nicely-ordered foo_initcall()'s, and the old-fashioned
> > legacy __initcall happens to map onto device_initcall().
> > 
> > Such code should use device_initcall() directly.  So we see at which
> > stage in initcalls this function will be called.
> 
> Yeah fair enough. 
> 
> A little git'ing tells me there were 31 new __initcall()'s added between
> 2.6.24 and 2.6.25, and there are 12 more lurking between 2.6.25 and
> linux-next. They're breeding!
> 
> You can't stick a #warning inside a #define can you? How about:
> 
> #define __initcall(fn)				\
> do {						\
> int Use_device_initcall_not___initcall_please;	\
> device_initcall(fn);				\
> } while (0)
> 
> Which gives:
> warning: unused variable ______Use_device_initcall_not___initcall_please___
> 
> ..
> 
> Yeah OK that was a joke.

I'm sure Andy can give us a checkpatch warning when someone uses
__initcall.  That'll help a bit.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-05-15 17:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-14 23:12 [patch 3/4] macintosh: replace deprecated __initcall with device_initcall akpm
2008-05-15  4:14 ` Paul Mackerras
2008-05-15  6:06   ` Andrew Morton
2008-05-15  6:28     ` Michael Ellerman
2008-05-15  6:41       ` Andrew Morton
2008-05-15  9:08         ` Michael Ellerman
2008-05-15 17:43           ` Andrew Morton

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).