]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
lib/scatterlist: make ARCH_HAS_SG_CHAIN an actual Kconfig
authorLaura Abbott <lauraa@codeaurora.org>
Thu, 22 May 2014 00:44:20 +0000 (10:44 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 22 May 2014 00:44:20 +0000 (10:44 +1000)
Rather than have architectures #define ARCH_HAS_SG_CHAIN in an
architecture specific scatterlist.h, make it a proper Kconfig option and
use that instead.  At same time, remove the header files are are now
mostly useless and just include asm-generic/scatterlist.h.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de> [x86]
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> [powerpc]
Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
23 files changed:
arch/arm/Kconfig
arch/arm/include/asm/Kbuild
arch/arm/include/asm/scatterlist.h [deleted file]
arch/arm64/Kconfig
arch/ia64/Kconfig
arch/ia64/include/asm/Kbuild
arch/ia64/include/asm/scatterlist.h [deleted file]
arch/powerpc/Kconfig
arch/powerpc/include/asm/Kbuild
arch/powerpc/include/asm/scatterlist.h [deleted file]
arch/s390/Kconfig
arch/s390/include/asm/Kbuild
arch/s390/include/asm/scatterlist.h [deleted file]
arch/sparc/Kconfig
arch/sparc/include/asm/Kbuild
arch/sparc/include/asm/scatterlist.h [deleted file]
arch/x86/Kconfig
arch/x86/include/asm/Kbuild
arch/x86/include/asm/scatterlist.h [deleted file]
include/linux/scatterlist.h
include/scsi/scsi.h
lib/Kconfig
lib/scatterlist.c

index db3c5414223e7298346c6338665263d5f51c0e3c..8f4cd2262692c4078a010c2e9ea1107f4514e678 100644 (file)
@@ -83,6 +83,7 @@ config ARM
          <http://www.arm.linux.org.uk/>.
 
 config ARM_HAS_SG_CHAIN
+       select ARCH_HAS_SG_CHAIN
        bool
 
 config NEED_SG_DMA_LENGTH
index 23e728ecf8ab3707403c811b6b43baead7198380..2d95820276fd1b947cd0efb6df97e5c86c49149a 100644 (file)
@@ -21,6 +21,7 @@ generic-y += parport.h
 generic-y += poll.h
 generic-y += preempt.h
 generic-y += resource.h
+generic-y += scatterlist.h
 generic-y += sections.h
 generic-y += segment.h
 generic-y += sembuf.h
diff --git a/arch/arm/include/asm/scatterlist.h b/arch/arm/include/asm/scatterlist.h
deleted file mode 100644 (file)
index cefdb8f..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef _ASMARM_SCATTERLIST_H
-#define _ASMARM_SCATTERLIST_H
-
-#ifdef CONFIG_ARM_HAS_SG_CHAIN
-#define ARCH_HAS_SG_CHAIN
-#endif
-
-#include <asm/memory.h>
-#include <asm/types.h>
-#include <asm-generic/scatterlist.h>
-
-#endif /* _ASMARM_SCATTERLIST_H */
index e759af5d70988ea27959db20c7ef510a621ad335..71036b6286f7b73d61ebf6964e73ef5009085a0b 100644 (file)
@@ -2,6 +2,7 @@ config ARM64
        def_bool y
        select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
        select ARCH_USE_CMPXCHG_LOCKREF
+       select ARCH_HAS_SG_CHAIN
        select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
        select ARCH_WANT_OPTIONAL_GPIOLIB
        select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
index 12c3afee0f6fabcd664c12e7ddca1bf367bc401e..43e7290fbccfd2b68224b129862e49fbf0fcd45b 100644 (file)
@@ -27,6 +27,7 @@ config IA64
        select HAVE_MEMBLOCK
        select HAVE_MEMBLOCK_NODE_MAP
        select HAVE_VIRT_CPU_ACCOUNTING
+       select ARCH_HAS_SG_CHAIN
        select VIRT_TO_BUS
        select ARCH_DISCARD_MEMBLOCK
        select GENERIC_IRQ_PROBE
index 0da4aa2602ae01d9badaca0f960e8d6b4c16ae2b..e8317d2d6c8d4462fe2536e5863ba628e3e44194 100644 (file)
@@ -5,5 +5,6 @@ generic-y += hash.h
 generic-y += kvm_para.h
 generic-y += mcs_spinlock.h
 generic-y += preempt.h
+generic-y += scatterlist.h
 generic-y += trace_clock.h
 generic-y += vtime.h
diff --git a/arch/ia64/include/asm/scatterlist.h b/arch/ia64/include/asm/scatterlist.h
deleted file mode 100644 (file)
index 08fd93b..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef _ASM_IA64_SCATTERLIST_H
-#define _ASM_IA64_SCATTERLIST_H
-
-#include <asm-generic/scatterlist.h>
-#define ARCH_HAS_SG_CHAIN
-
-#endif /* _ASM_IA64_SCATTERLIST_H */
index e0998997943bf789cddb11967781b595850574bc..caece570d0b49361feb3bafb025fb3ed5e9eeb39 100644 (file)
@@ -111,6 +111,7 @@ config PPC
        select HAVE_DMA_API_DEBUG
        select HAVE_OPROFILE
        select HAVE_DEBUG_KMEMLEAK
+       select ARCH_HAS_SG_CHAIN
        select GENERIC_ATOMIC64 if PPC32
        select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
        select HAVE_PERF_EVENTS
index 3fb1bc432f4f6106f1a892ce02113ec68970af6a..7f23f162ce9c0c40a9e29eebba12cdd1db4c6704 100644 (file)
@@ -4,5 +4,6 @@ generic-y += hash.h
 generic-y += mcs_spinlock.h
 generic-y += preempt.h
 generic-y += rwsem.h
+generic-y += scatterlist.h
 generic-y += trace_clock.h
 generic-y += vtime.h
diff --git a/arch/powerpc/include/asm/scatterlist.h b/arch/powerpc/include/asm/scatterlist.h
deleted file mode 100644 (file)
index de1f620..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#ifndef _ASM_POWERPC_SCATTERLIST_H
-#define _ASM_POWERPC_SCATTERLIST_H
-/*
- * Copyright (C) 2001 PPC64 Team, IBM Corp
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- */
-
-#include <asm/dma.h>
-#include <asm-generic/scatterlist.h>
-
-#define ARCH_HAS_SG_CHAIN
-
-#endif /* _ASM_POWERPC_SCATTERLIST_H */
index d68fe34799b0fc8f988b81bbeaf3a14d40afc8e3..54cb543470d0239d4acb482c95929e3f1af4ecec 100644 (file)
@@ -145,6 +145,7 @@ config S390
        select TTY
        select VIRT_CPU_ACCOUNTING
        select VIRT_TO_BUS
+       select ARCH_HAS_SG_CHAIN
 
 config SCHED_OMIT_FRAME_POINTER
        def_bool y
index 57892a8a905584d79fd112a7c2e67a319a3f9e45..b3fea0722ff1f80e71809f45f61ad48b66805ea1 100644 (file)
@@ -4,4 +4,5 @@ generic-y += clkdev.h
 generic-y += hash.h
 generic-y += mcs_spinlock.h
 generic-y += preempt.h
+generic-y += scatterlist.h
 generic-y += trace_clock.h
diff --git a/arch/s390/include/asm/scatterlist.h b/arch/s390/include/asm/scatterlist.h
deleted file mode 100644 (file)
index 6d45ef6..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#include <asm-generic/scatterlist.h>
-
-#define ARCH_HAS_SG_CHAIN
index 29f2e988c56a9be4cb8824942f1226ebf958670f..e1ea0ff154d713243a1edd39be28ed6b3fb1bc5c 100644 (file)
@@ -42,6 +42,7 @@ config SPARC
        select MODULES_USE_ELF_RELA
        select ODD_RT_SIGACTION
        select OLD_SIGSUSPEND
+       select ARCH_HAS_SG_CHAIN
 
 config SPARC32
        def_bool !64BIT
index a45821818003fce80d501b59653ac35eedcc6875..cdd1b447bb6cac1f10cc2a5239e1a477f7e6bb06 100644 (file)
@@ -15,6 +15,7 @@ generic-y += mcs_spinlock.h
 generic-y += module.h
 generic-y += mutex.h
 generic-y += preempt.h
+generic-y += scatterlist.h
 generic-y += serial.h
 generic-y += trace_clock.h
 generic-y += types.h
diff --git a/arch/sparc/include/asm/scatterlist.h b/arch/sparc/include/asm/scatterlist.h
deleted file mode 100644 (file)
index 92bb638..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef _SPARC_SCATTERLIST_H
-#define _SPARC_SCATTERLIST_H
-
-#include <asm-generic/scatterlist.h>
-
-#define ARCH_HAS_SG_CHAIN
-
-#endif /* !(_SPARC_SCATTERLIST_H) */
index c1fd51b87caa7f9d6f71fdd13681aa835335cf69..06a09d968b3b82b7530f410d0aeef5fc53e5c51f 100644 (file)
@@ -96,6 +96,7 @@ config X86
        select IRQ_FORCED_THREADING
        select HAVE_BPF_JIT if X86_64
        select HAVE_ARCH_TRANSPARENT_HUGEPAGE
+       select ARCH_HAS_SG_CHAIN
        select CLKEVT_I8253
        select ARCH_HAVE_NMI_SAFE_CMPXCHG
        select GENERIC_IOMAP
index 3ca9762e1649d001e653468f98fff17a57065039..3bf000fab0aeb51b3fa23bfa1faca8b3a581febc 100644 (file)
@@ -5,6 +5,7 @@ genhdr-y += unistd_64.h
 genhdr-y += unistd_x32.h
 
 generic-y += clkdev.h
-generic-y += early_ioremap.h
 generic-y += cputime.h
+generic-y += early_ioremap.h
 generic-y += mcs_spinlock.h
+generic-y += scatterlist.h
diff --git a/arch/x86/include/asm/scatterlist.h b/arch/x86/include/asm/scatterlist.h
deleted file mode 100644 (file)
index 4240878..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef _ASM_X86_SCATTERLIST_H
-#define _ASM_X86_SCATTERLIST_H
-
-#include <asm-generic/scatterlist.h>
-
-#define ARCH_HAS_SG_CHAIN
-
-#endif /* _ASM_X86_SCATTERLIST_H */
index a964f728560031d0983690c0a3a261fc933b432c..4b152c81c5fa4eb27199b24d08489d4784bbacd2 100644 (file)
@@ -136,7 +136,7 @@ static inline void sg_set_buf(struct scatterlist *sg, const void *buf,
 static inline void sg_chain(struct scatterlist *prv, unsigned int prv_nents,
                            struct scatterlist *sgl)
 {
-#ifndef ARCH_HAS_SG_CHAIN
+#ifndef CONFIG_ARCH_HAS_SG_CHAIN
        BUG();
 #endif
 
index 0a4edfe8af510ad7739ea931c559dbef11727b68..d34cf2df093b20e0506141d4d71607d07d8c12d6 100644 (file)
@@ -31,7 +31,7 @@ enum scsi_timeouts {
  * Like SCSI_MAX_SG_SEGMENTS, but for archs that have sg chaining. This limit
  * is totally arbitrary, a setting of 2048 will get you at least 8mb ios.
  */
-#ifdef ARCH_HAS_SG_CHAIN
+#ifdef CONFIG_ARCH_HAS_SG_CHAIN
 #define SCSI_MAX_SG_CHAIN_SEGMENTS     2048
 #else
 #define SCSI_MAX_SG_CHAIN_SEGMENTS     SCSI_MAX_SG_SEGMENTS
index 507ad6489f1f36bd808f71107905e6182862f305..e5ae36dcbf0147ae24ee28287c1a122d9fe85812 100644 (file)
@@ -467,4 +467,11 @@ config UCS2_STRING
 
 source "lib/fonts/Kconfig"
 
+#
+# sg chaining option
+#
+
+config ARCH_HAS_SG_CHAIN
+       def_bool n
+
 endmenu
index 3a8e8e8fb2a5e23294b7e6e6e4fcd439d07674f9..4251cbd5becb3c851e38ffd0b77eedd0d08932d5 100644 (file)
@@ -73,7 +73,7 @@ EXPORT_SYMBOL(sg_nents);
  **/
 struct scatterlist *sg_last(struct scatterlist *sgl, unsigned int nents)
 {
-#ifndef ARCH_HAS_SG_CHAIN
+#ifndef CONFIG_ARCH_HAS_SG_CHAIN
        struct scatterlist *ret = &sgl[nents - 1];
 #else
        struct scatterlist *sg, *ret = NULL;
@@ -251,7 +251,7 @@ int __sg_alloc_table(struct sg_table *table, unsigned int nents,
 
        if (nents == 0)
                return -EINVAL;
-#ifndef ARCH_HAS_SG_CHAIN
+#ifndef CONFIG_ARCH_HAS_SG_CHAIN
        if (WARN_ON_ONCE(nents > max_ents))
                return -EINVAL;
 #endif