Skip to contentSkip to conversation

don't include <asm/> headers

PATCH In review Sebastian Siewior 2 participants 5 messages Apr 26, 2008 – May 9, 2008

Subsystems (6)
Arm (32-bit) x86 Crypto API MD RAID +2 more subsystems
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 don't include <asm/> headers

From: Sebastian Siewior <[email protected]>

Including arch dependent header files from arch indepent .c code causes randconfig builds to fail. This patch fixes build problems on arches which are not tested by Adrian like m68knommu.

---
 arch/alpha/Kconfig        |    1 +
 arch/arm/Kconfig          |    1 +
 arch/ia64/Kconfig         |    1 +
 arch/sparc/Kconfig        |    1 +
 arch/sparc64/Kconfig      |    2 ++
 arch/x86/Kconfig          |    2 +-
 crypto/Kconfig            |    3 +++
 crypto/xor.c              |    1 -
 include/asm-avr32/xor.h   |    6 ------
 include/asm-frv/xor.h     |    1 -
 include/asm-m32r/xor.h    |    6 ------
 include/asm-m68k/xor.h    |    1 -
 include/asm-mips/xor.h    |    1 -
 include/asm-mn10300/xor.h |    1 -
 include/asm-parisc/xor.h  |    1 -
 include/asm-powerpc/xor.h |    1 -
 include/asm-s390/xor.h    |    1 -
 include/asm-sh/xor.h      |    1 -
 include/asm-um/xor.h      |    6 ------
 include/asm-xtensa/xor.h  |   16 ----------------
 include/linux/raid/xor.h  |    6 ++++++
 21 files changed, 16 insertions(+), 44 deletions(-)
 delete mode 100644 include/asm-avr32/xor.h
 delete mode 100644 include/asm-frv/xor.h
 delete mode 100644 include/asm-m32r/xor.h
 delete mode 100644 include/asm-m68k/xor.h
 delete mode 100644 include/asm-mips/xor.h
 delete mode 100644 include/asm-mn10300/xor.h
 delete mode 100644 include/asm-parisc/xor.h
 delete mode 100644 include/asm-powerpc/xor.h
 delete mode 100644 include/asm-s390/xor.h
 delete mode 100644 include/asm-sh/xor.h
 delete mode 100644 include/asm-um/xor.h
 delete mode 100644 include/asm-xtensa/xor.h
arch/alpha/Kconfig +1 -0
index 729cdbd..04b318a 100644
@@ -7,6 +7,7 @@ config ALPHA
 	default y
 	select HAVE_IDE
 	select HAVE_OPROFILE
+	select HAVE_ARCH_XOR
 	help
 	  The Alpha is a 64-bit general-purpose processor designed and
 	  marketed by the Digital Equipment Corporation of blessed memory,
arch/arm/Kconfig +1 -0
index d8d2532..fa22db3 100644
@@ -13,6 +13,7 @@ config ARM
 	select HAVE_OPROFILE
 	select HAVE_KPROBES if (!XIP_KERNEL)
 	select HAVE_KRETPROBES if (HAVE_KPROBES)
+	select HAVE_ARCH_XOR
 	help
 	  The ARM series is a line of low-power-consumption RISC chip designs
 	  licensed by ARM Ltd and targeted at embedded applications and
arch/ia64/Kconfig +1 -0
index cd13e13..4b18d6e 100644
@@ -19,6 +19,7 @@ config IA64
 	select HAVE_OPROFILE
 	select HAVE_KPROBES
 	select HAVE_KRETPROBES
+	select HAVE_ARCH_XOR
 	default y
 	help
 	  The Itanium Processor Family is Intel's 64-bit successor to
arch/sparc/Kconfig +1 -0
index 49590f8..dd3e949 100644
@@ -73,6 +73,7 @@ config SPARC
 config SPARC32
 	bool
 	default y
+	select HAVE_ARCH_XOR
 	help
 	  SPARC is a family of RISC microprocessors designed and marketed by
 	  Sun Microsystems, incorporated.  They are very widely found in Sun
arch/sparc64/Kconfig +2 -0
index 8acc5cc..ee659a8 100644
@@ -11,12 +11,14 @@ config SPARC
 	select HAVE_OPROFILE
 	select HAVE_KPROBES
 	select HAVE_KRETPROBES
+	select HAVE_ARCH_XOR
 
 config SPARC64
 	bool
 	default y
 	select HAVE_IDE
 	select HAVE_LMB
+	select HAVE_ARCH_XOR
 	help
 	  SPARC is a family of RISC microprocessors designed and marketed by
 	  Sun Microsystems, incorporated.  This port covers the newer 64-bit
arch/x86/Kconfig +1 -1
index 4d350b5..b43095f 100644
@@ -24,7 +24,7 @@ config X86
 	select HAVE_KRETPROBES
 	select HAVE_KVM if ((X86_32 && !X86_VOYAGER && !X86_VISWS && !X86_NUMAQ) || X86_64)
 	select HAVE_ARCH_KGDB if !X86_VOYAGER
-
+	select HAVE_ARCH_XOR
 
 config GENERIC_LOCKBREAK
 	def_bool n
crypto/Kconfig +3 -0
index 864456c..9a49abd 100644
@@ -1,6 +1,9 @@
 #
 # Generic algorithms support
 #
+config HAVE_ARCH_XOR
+	bool
+
 config XOR_BLOCKS
 	tristate
 
crypto/xor.c +0 -1
index b2e6db0..1992a34 100644
@@ -20,7 +20,6 @@
 #include <linux/module.h>
 #include <linux/raid/md.h>
 #include <linux/raid/xor.h>
-#include <asm/xor.h>
 
 /* The xor routines to use.  */
 static struct xor_block_template *active_template;
include/asm-avr32/xor.h deleted +0 -6
deleted file mode 100644
index 99c87aa..0000000
@@ -1,6 +0,0 @@
-#ifndef _ASM_XOR_H
-#define _ASM_XOR_H
-
-#include <asm-generic/xor.h>
-
-#endif
include/asm-frv/xor.h deleted +0 -1
deleted file mode 100644
index c82eb12..0000000
@@ -1 +0,0 @@
-#include <asm-generic/xor.h>
include/asm-m32r/xor.h deleted +0 -6
deleted file mode 100644
index 6d52525..0000000
@@ -1,6 +0,0 @@
-#ifndef _ASM_M32R_XOR_H
-#define _ASM_M32R_XOR_H
-
-#include <asm-generic/xor.h>
-
-#endif  /* _ASM_M32R_XOR_H */
include/asm-m68k/xor.h deleted +0 -1
deleted file mode 100644
index c82eb12..0000000
@@ -1 +0,0 @@
-#include <asm-generic/xor.h>
include/asm-mips/xor.h deleted +0 -1
deleted file mode 100644
index c82eb12..0000000
@@ -1 +0,0 @@
-#include <asm-generic/xor.h>
include/asm-mn10300/xor.h deleted +0 -1
deleted file mode 100644
index c82eb12..0000000
@@ -1 +0,0 @@
-#include <asm-generic/xor.h>
include/asm-parisc/xor.h deleted +0 -1
deleted file mode 100644
index c82eb12..0000000
@@ -1 +0,0 @@
-#include <asm-generic/xor.h>
include/asm-powerpc/xor.h deleted +0 -1
deleted file mode 100644
index c82eb12..0000000
@@ -1 +0,0 @@
-#include <asm-generic/xor.h>
include/asm-s390/xor.h deleted +0 -1
deleted file mode 100644
index c82eb12..0000000
@@ -1 +0,0 @@
-#include <asm-generic/xor.h>
include/asm-sh/xor.h deleted +0 -1
deleted file mode 100644
index c82eb12..0000000
@@ -1 +0,0 @@
-#include <asm-generic/xor.h>
include/asm-um/xor.h deleted +0 -6
deleted file mode 100644
index a19db3e..0000000
@@ -1,6 +0,0 @@
-#ifndef __UM_XOR_H
-#define __UM_XOR_H
-
-#include "asm-generic/xor.h"
-
-#endif
include/asm-xtensa/xor.h deleted +0 -16
deleted file mode 100644
index e7b1f08..0000000
@@ -1,16 +0,0 @@
-/*
- * include/asm-xtensa/xor.h
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 2001 - 2005 Tensilica Inc.
- */
-
-#ifndef _XTENSA_XOR_H
-#define _XTENSA_XOR_H
-
-#include <asm-generic/xor.h>
-
-#endif
include/linux/raid/xor.h +6 -0
index 3e12058..51e8ae9 100644
@@ -21,4 +21,10 @@ struct xor_block_template {
 		     unsigned long *, unsigned long *, unsigned long *);
 };
 
+#ifdef CONFIG_HAVE_ARCH_XOR
+#include <asm/xor.h>
+#else
+#include <asm-generic/xor.h>
+#endif
+
 #endif
Signature · 1 line
1.5.4.5
#1 lore raw
Quoted 7 lines · Sebastian Siewior

From: Sebastian Siewior <[email protected]>

Including arch dependent header files from arch indepent .c code causes randconfig builds to fail. This patch fixes build problems on arches which are not tested by Adrian like m68knommu.

Thanks, I'll push this out for testing in -next / -mm.

--
Dan

#2 lore raw
Quoted 1 line · * Dan Williams | 2008-04-29 23:42:46 [-0700]:

Thanks, I'll push this out for testing in -next / -mm.

I can't see this in current -next and I can't remember that I got an email from Andrew.

Quoted 3 lines

--
Dan

Sebastian

#3 lore raw
Quoted 7 lines · Sebastian Siewior
Quoted 1 line · * Dan Williams | 2008-04-29 23:42:46 [-0700]:

Thanks, I'll push this out for testing in -next / -mm.

I can't see this in current -next and I can't remember that I got an email from Andrew.

Hi Sebastian,

Yes I had put this in the background for awhile due to other issues. I fixed up a few merge conflicts so that it will apply against the current tree; however, the patch causes these new warnings:

include/asm/xor_32.h:513: warning: 'xor_block_pII_mmx' defined but not used include/asm/xor_32.h:521: warning: 'xor_block_p5_mmx' defined but not used include/asm/xor_32.h:853: warning: 'xor_block_pIII_sse' defined but not used include/asm-generic/xor.h:680: warning: 'xor_block_8regs' defined but not used include/asm-generic/xor.h:688: warning: 'xor_block_32regs' defined but not used include/asm-generic/xor.h:696: warning: 'xor_block_8regs_p' defined but not used include/asm-generic/xor.h:704: warning: 'xor_block_32regs_p' defined but not used

It is not immediately clear why?

--
Dan

#4 lore raw
Quoted 10 lines · * Dan Williams | 2008-05-09 11:55:25 [-0700]:
Quoted 7 lines · Sebastian Siewior
Quoted 1 line · * Dan Williams | 2008-04-29 23:42:46 [-0700]:

Thanks, I'll push this out for testing in -next / -mm.

I can't see this in current -next and I can't remember that I got an email from Andrew.

Hi Sebastian,

Hi Dan,

Quoted 1 line

Yes I had put this in the background for awhile due to other issues.

No problem. If you queue this up for another two weeks than I have no problem with it. I just wanted to make sure that you did not lose it :)

Quoted 12 lines

I fixed up a few merge conflicts so that it will apply against the current tree; however, the patch causes these new warnings:

include/asm/xor_32.h:513: warning: 'xor_block_pII_mmx' defined but not used include/asm/xor_32.h:521: warning: 'xor_block_p5_mmx' defined but not used include/asm/xor_32.h:853: warning: 'xor_block_pIII_sse' defined but not used include/asm-generic/xor.h:680: warning: 'xor_block_8regs' defined but not used include/asm-generic/xor.h:688: warning: 'xor_block_32regs' defined but not used include/asm-generic/xor.h:696: warning: 'xor_block_8regs_p' defined but not used include/asm-generic/xor.h:704: warning: 'xor_block_32regs_p' defined but not used

Quoted 1 line

It is not immediately clear why?

I'm not sure why I haven't seen this myself. crypto/xor.c is the only user of those defines but linux/raid/xor.h is also included by async_xor.c which does not use xor_block_pII_mmx & friends. The best thing would be probably _not_ to merge those two header files like I did but keep them separate. Maybe we could move this define directly into crypto/xor.c since it is the only user?

Sebastian