Skip to contentSkip to conversation

2.6: is include/linux/platform.h a dead header?

PATCH In review Adrian Bunk 4 participants 9 messages Sep 2, 2005 – Nov 8, 2005 1 message not in the archive SuperH

lore
Share & tools
lore
#0 lore raw

Hi Patrick,

it seems that exept for the default_idle() prototype, the complete include/linux/platform.h is obsolete.

Is there a reason to keep it, or should we delete this header?

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#2 lore raw

PATCH 1/1 kill include/linux/platform.h

In reply to a message not in the archive
Quoted 5 lines · Patrick Mochel

Sorry about the delay in responding, been traveling.

On Fri, 2 Sep 2005, Adrian Bunk wrote:

Quoted 8 lines
Quoted 6 lines

Hi Patrick,

it seems that exept for the default_idle() prototype, the complete include/linux/platform.h is obsolete.

Is there a reason to keep it, or should we delete this header?

Kill it, it's way old.

Patch below.

Quoted 2 lines

Thanks,
Patrick

cu
Adrian

<-- snip -->

This patch removes the obsolete include/linux/platform.h header.

This patch was already ACK'ed by Patrick Mochel.

---

 arch/i386/mach-visws/reboot.c |    1 
 arch/ia64/kernel/setup.c      |    1 
 arch/sh/kernel/process.c      |    1 
 include/linux/platform.h      |   43 ----------------------------------
 4 files changed, 46 deletions(-)
arch/i386/mach-visws/reboot.c renamed from arch/i386/mach-visws/reboot.c.old +0 -1
@@ -1,7 +1,6 @@
 #include <linux/module.h>
 #include <linux/smp.h>
 #include <linux/delay.h>
-#include <linux/platform.h>
 
 #include <asm/io.h>
 #include "piix4.h"
arch/ia64/kernel/setup.c renamed from arch/ia64/kernel/setup.c.old +0 -1
@@ -41,7 +41,6 @@
 #include <linux/serial_core.h>
 #include <linux/efi.h>
 #include <linux/initrd.h>
-#include <linux/platform.h>
 #include <linux/pm.h>
 
 #include <asm/ia32.h>
arch/sh/kernel/process.c renamed from arch/sh/kernel/process.c.old +0 -1
@@ -18,7 +18,6 @@
 #include <linux/slab.h>
 #include <linux/a.out.h>
 #include <linux/ptrace.h>
-#include <linux/platform.h>
 #include <linux/kallsyms.h>
 
 #include <asm/io.h>
include/linux/platform.h deleted +0 -43

43 lines not on this page · raw message

#3 lore raw

Re: [2.6 patch] kill include/linux/platform.h

arch/ia64/kernel/setup.c 2005-10-02 01:09:15.000000000 +0200 line 46

Quoted 10 lines
arch/ia64/kernel/setup.c 2005-10-02 01:09:15.000000000 +0200 renamed from arch/ia64/kernel/setup.c.old 2005-10-02 01:09:11.000000000 +0200 +0 -1
@@ -41,7 +41,6 @@
 #include <linux/serial_core.h>
 #include <linux/efi.h>
 #include <linux/initrd.h>
-#include <linux/platform.h>
 #include <linux/pm.h>
 
 #include <asm/ia32.h>

NAK. Without <linux/platform.h> ia64 doesn't compile:

CC arch/ia64/kernel/setup.o
arch/ia64/kernel/setup.c: In function `cpu_init':
arch/ia64/kernel/setup.c:855: error: `default_idle' undeclared (first use in this function)
arch/ia64/kernel/setup.c:855: error: (Each undeclared identifier is reported only once
arch/ia64/kernel/setup.c:855: error: for each function it appears in.) make[1]: *** [arch/ia64/kernel/setup.o] Error 1
make: *** [arch/ia64/kernel] Error 2

So you will need to add a:

extern void default_idle(void );

some place in setup.c to fix this.

-Tony

#4 lore raw

Re: [2.6 patch] kill include/linux/platform.h

Quoted 23 lines · Tony Luck

arch/ia64/kernel/setup.c 2005-10-02 01:09:15.000000000 +0200 line 46

Quoted 10 lines
arch/ia64/kernel/setup.c 2005-10-02 01:09:15.000000000 +0200 renamed from arch/ia64/kernel/setup.c.old 2005-10-02 01:09:11.000000000 +0200 +0 -1
@@ -41,7 +41,6 @@
 #include <linux/serial_core.h>
 #include <linux/efi.h>
 #include <linux/initrd.h>
-#include <linux/platform.h>
 #include <linux/pm.h>
 
 #include <asm/ia32.h>

NAK. Without <linux/platform.h> ia64 doesn't compile:

CC arch/ia64/kernel/setup.o
arch/ia64/kernel/setup.c: In function `cpu_init':
arch/ia64/kernel/setup.c:855: error: `default_idle' undeclared (first use in this function)
arch/ia64/kernel/setup.c:855: error: (Each undeclared identifier is reported only once
arch/ia64/kernel/setup.c:855: error: for each function it appears in.) make[1]: *** [arch/ia64/kernel/setup.o] Error 1
make: *** [arch/ia64/kernel] Error 2

Quoted 5 lines

So you will need to add a:

extern void default_idle(void );

some place in setup.c to fix this.

The default_idle() prototype should stay inside some header file.

@Patrick:
Any suggestion where it should move to?

Quoted 1 line

-Tony

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#5 lore raw

Re: [2.6 patch] kill include/linux/platform.h

Quoted 1 line

The default_idle() prototype should stay inside some header file.

That would be best, yes.

Quoted 2 lines

@Patrick:
Any suggestion where it should move to?

Of the include files already included directly by arch/ia64/kernel/setup.c, <linux/sched.h> looks the most promising. There's lots of .*idle.* things already in there.

Looking at existing precedent: ppc64 has a definition of default_idle() in <asm/machdep.h>

i396, cris and um already have gone along the route of adding extern definitions for default_idle() to ".c" files ... so cleanup creates more opportunities for cleanup (but you are probably very experienced in this phenomenom :-)

-Tony

#6 lore raw

Re: [2.6 patch] kill include/linux/platform.h

Quoted 7 lines · Tony Luck
Quoted 1 line

The default_idle() prototype should stay inside some header file.

That would be best, yes.

Quoted 2 lines

@Patrick:
Any suggestion where it should move to?

Quoted 6 lines

Of the include files already included directly by arch/ia64/kernel/setup.c, <linux/sched.h> looks the most promising. There's lots of .*idle.* things already in there.

Looking at existing precedent: ppc64 has a definition of default_idle() in <asm/machdep.h>

The question whether linux/ or asm/ is the best place for the definition boils down to the question whether it is expected that default_idle() is present on all architectures or whether it's an architecture-specific implementation detail.

In the first case, I'm surprised that there is no platform independent code using it.

In the second case, it seems we can kill the default_idle() functions on mips (empty) and parisk.

Quoted 4 lines

i396, cris and um already have gone along the route of adding extern definitions for default_idle() to ".c" files ... so cleanup creates more opportunities for cleanup (but you are probably very experienced in this phenomenom :-)

I stumbled across the question whether include/linux/platform.h is still required by cleaning up warnings with the -Wmissing-prototypes compiler flag I plan to add to the kernel CFLAGS soon that generates warnings for such extern constructs...

Quoted 1 line

-Tony

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#7 lore raw

Re: [2.6 patch] kill include/linux/platform.h

Quoted 13 lines · Adrian Bunk
Quoted 11 lines · Tony Luck
Quoted 1 line

The default_idle() prototype should stay inside some header file.

That would be best, yes.

Quoted 2 lines

@Patrick:
Any suggestion where it should move to?

Of the include files already included directly by arch/ia64/kernel/setup.c, <linux/sched.h> looks the most promising. There's lots of .*idle.* things already in there.

Quoted 7 lines
Quoted 2 lines

Looking at existing precedent: ppc64 has a definition of default_idle() in <asm/machdep.h>

The question whether linux/ or asm/ is the best place for the definition boils down to the question whether it is expected that default_idle() is present on all architectures or whether it's an architecture-specific implementation detail.

Yes, default_idle() is arch-specific and so its prototype should be in an arch-specific header.

All the implementations happen to have the same signature, so it's tempting to put the prototype into some generic header, but given that there's no non-arch-specific caller, we shouldn't do that.

#8 lore raw

Re: [2.6 patch] kill include/linux/platform.h

Quoted 22 lines · Andrew Morton
Quoted 13 lines · Adrian Bunk
Quoted 11 lines · Tony Luck
Quoted 1 line

The default_idle() prototype should stay inside some header file.

That would be best, yes.

Quoted 2 lines

@Patrick:
Any suggestion where it should move to?

Of the include files already included directly by arch/ia64/kernel/setup.c, <linux/sched.h> looks the most promising. There's lots of .*idle.* things already in there.

Quoted 7 lines
Quoted 2 lines

Looking at existing precedent: ppc64 has a definition of default_idle() in <asm/machdep.h>

The question whether linux/ or asm/ is the best place for the definition boils down to the question whether it is expected that default_idle() is present on all architectures or whether it's an architecture-specific implementation detail.

Quoted 6 lines

Yes, default_idle() is arch-specific and so its prototype should be in an arch-specific header.

All the implementations happen to have the same signature, so it's tempting to put the prototype into some generic header, but given that there's no non-arch-specific caller, we shouldn't do that.

ppc64 has the prototype in machdep.h.

The only other architectures that seem to require a non-static default_idle() are cris, i386 and ia64.

Any hint which header file would suit best?

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#9 lore raw

Re: [2.6 patch] kill include/linux/platform.h

Quoted 30 lines · Adrian Bunk
Quoted 22 lines · Andrew Morton
Quoted 13 lines · Adrian Bunk
Quoted 11 lines · Tony Luck
Quoted 1 line

The default_idle() prototype should stay inside some header file.

That would be best, yes.

Quoted 2 lines

@Patrick:
Any suggestion where it should move to?

Of the include files already included directly by arch/ia64/kernel/setup.c, <linux/sched.h> looks the most promising. There's lots of .*idle.* things already in there.

Quoted 7 lines
Quoted 2 lines

Looking at existing precedent: ppc64 has a definition of default_idle() in <asm/machdep.h>

The question whether linux/ or asm/ is the best place for the definition boils down to the question whether it is expected that default_idle() is present on all architectures or whether it's an architecture-specific implementation detail.

Quoted 6 lines

Yes, default_idle() is arch-specific and so its prototype should be in an arch-specific header.

All the implementations happen to have the same signature, so it's tempting to put the prototype into some generic header, but given that there's no non-arch-specific caller, we shouldn't do that.

Quoted 6 lines

ppc64 has the prototype in machdep.h.

The only other architectures that seem to require a non-static default_idle() are cris, i386 and ia64.

Any hint which header file would suit best?

It seems that include/asm-{$arch}/idle.h would suffice. Any objections to that?

Pat