2001-10-23 10:50:40

by Manik Raina

[permalink] [raw]
Subject: [PATCH] : preventing multiple includes of the same header file

Hi,

This patch should prevent multiple inclusions of some header
files in include/asm-ppc/

thanks
Manik

Index: serial.h
===================================================================
RCS file: /vger/linux/include/asm-ppc/serial.h,v
retrieving revision 1.14
diff -u -r1.14 serial.h
--- serial.h 23 May 2001 03:53:37 -0000 1.14
+++ serial.h 23 Oct 2001 10:45:31 -0000
@@ -6,6 +6,9 @@
*/

#ifdef __KERNEL__
+#ifndef __PPC_SERIAL_H__
+#define __PPC_SERIAL_H__
+
#include <linux/config.h>

#ifdef CONFIG_GEMINI
@@ -133,4 +136,5 @@
MCA_SERIAL_PORT_DFNS

#endif /* !CONFIG_GEMINI and others */
+#endif /* __PPC_SERIAL_H__ */
#endif /* __KERNEL__ */
Index: smplock.h
===================================================================
RCS file: /vger/linux/include/asm-ppc/smplock.h,v
retrieving revision 1.6
diff -u -r1.6 smplock.h
--- smplock.h 23 May 2001 03:53:37 -0000 1.6
+++ smplock.h 23 Oct 2001 10:45:31 -0000
@@ -7,6 +7,9 @@
* Default SMP lock implementation
*/
#ifdef __KERNEL__
+#ifndef __PPC_SMPLOCK_H__
+#define __PPC_SMPLOCK_H__
+
#include <linux/interrupt.h>
#include <linux/spinlock.h>

@@ -53,4 +56,5 @@
if (--current->lock_depth < 0)
spin_unlock(&kernel_flag);
}
+#endif /* __PPC_SMPLOCK_H__ */
#endif /* __KERNEL__ */
Index: time.h
===================================================================
RCS file: /vger/linux/include/asm-ppc/time.h,v
retrieving revision 1.10
diff -u -r1.10 time.h
--- time.h 28 Aug 2001 21:33:28 -0000 1.10
+++ time.h 23 Oct 2001 10:45:31 -0000
@@ -9,6 +9,9 @@
*/

#ifdef __KERNEL__
+#ifndef __PPC_TIME_H__
+#define __PPC_TIME_H__
+
#include <linux/config.h>
#include <linux/mc146818rtc.h>
#include <linux/threads.h>
@@ -136,4 +139,5 @@
({unsigned z; asm ("mulhwu %0,%1,%2" : "=r" (z) : "r" (x), "r" (y)); z;})

unsigned mulhwu_scale_factor(unsigned, unsigned);
+#endif /* __PPC_TIME_H__ */
#endif /* __KERNEL__ */
Index: uninorth.h
===================================================================
RCS file: /vger/linux/include/asm-ppc/uninorth.h,v
retrieving revision 1.5
diff -u -r1.5 uninorth.h
--- uninorth.h 28 Aug 2001 21:33:28 -0000 1.5
+++ uninorth.h 23 Oct 2001 10:45:31 -0000
@@ -7,7 +7,8 @@
*
*/
#ifdef __KERNEL__
-
+#ifndef __PPC_UNINORTH_H__
+#define __PPC_UNINORTH_H__

/*
* Uni-N config space reg. definitions
@@ -131,4 +132,5 @@

/* Uninorth 1.5 rev. has additional perf. monitor registers at 0xf00-0xf50 */

+#endif /* __PPC_UNINORTH_H__ */
#endif /* __KERNEL__ */


2001-10-23 15:09:31

by Tom Rini

[permalink] [raw]
Subject: Re: [PATCH] : preventing multiple includes of the same header file

On Tue, Oct 23, 2001 at 04:20:35PM +0530, Manik Raina wrote:

> This patch should prevent multiple inclusions of some header
> files in include/asm-ppc/

I've changed _PPC_xxx_H to _ASM_xxx_H to match the rest of the headers.
This is now in the PPC bk tree, and will eventually hit Linus' tree,
thanks!

--
Tom Rini (TR1265)
http://gate.crashing.org/~trini/

2001-10-26 15:52:06

by Manik Raina

[permalink] [raw]
Subject: Re: [PATCH] : preventing multiple includes of the same header file

> I've changed _PPC_xxx_H to _ASM_xxx_H to match the rest of the headers.
> This is now in the PPC bk tree, and will eventually hit Linus' tree,
> thanks!
>

Would point your kind attention towards some others files in the same
directory
(include/asm-ppc) which dont follow _PPC_XXX_H convention either.....

residual.h
rxplite.h
rpxhiox.h

and a few more ....

thanks
Manik



2001-10-26 15:57:27

by Tom Rini

[permalink] [raw]
Subject: Re: [PATCH] : preventing multiple includes of the same header file

On Fri, Oct 26, 2001 at 09:21:25PM +0530, Manik Raina wrote:
> > I've changed _PPC_xxx_H to _ASM_xxx_H to match the rest of the headers.
> > This is now in the PPC bk tree, and will eventually hit Linus' tree,
> > thanks!
> >
>
> Would point your kind attention towards some others files in the same
> directory
> (include/asm-ppc) which dont follow _PPC_XXX_H convention either.....

They'll get cleaned up eventually. Thanks for pointing 'em out.

--
Tom Rini (TR1265)
http://gate.crashing.org/~trini/