Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

lib/scatterlist: make ARCH_HAS_SG_CHAIN an actual Kconfig

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.

[sfr@canb.auug.org.au: powerpc files now need asm/dma.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: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Laura Abbott and committed by
Linus Torvalds
308c09f1 2f137d66

+30 -60
+1
arch/arm/Kconfig
··· 83 83 <http://www.arm.linux.org.uk/>. 84 84 85 85 config ARM_HAS_SG_CHAIN 86 + select ARCH_HAS_SG_CHAIN 86 87 bool 87 88 88 89 config NEED_SG_DMA_LENGTH
+1
arch/arm/include/asm/Kbuild
··· 22 22 generic-y += preempt.h 23 23 generic-y += resource.h 24 24 generic-y += rwsem.h 25 + generic-y += scatterlist.h 25 26 generic-y += sections.h 26 27 generic-y += segment.h 27 28 generic-y += sembuf.h
-12
arch/arm/include/asm/scatterlist.h
··· 1 - #ifndef _ASMARM_SCATTERLIST_H 2 - #define _ASMARM_SCATTERLIST_H 3 - 4 - #ifdef CONFIG_ARM_HAS_SG_CHAIN 5 - #define ARCH_HAS_SG_CHAIN 6 - #endif 7 - 8 - #include <asm/memory.h> 9 - #include <asm/types.h> 10 - #include <asm-generic/scatterlist.h> 11 - 12 - #endif /* _ASMARM_SCATTERLIST_H */
+1
arch/arm64/Kconfig
··· 1 1 config ARM64 2 2 def_bool y 3 3 select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE 4 + select ARCH_HAS_SG_CHAIN 4 5 select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST 5 6 select ARCH_USE_CMPXCHG_LOCKREF 6 7 select ARCH_SUPPORTS_ATOMIC_RMW
+1
arch/ia64/Kconfig
··· 28 28 select HAVE_MEMBLOCK 29 29 select HAVE_MEMBLOCK_NODE_MAP 30 30 select HAVE_VIRT_CPU_ACCOUNTING 31 + select ARCH_HAS_SG_CHAIN 31 32 select VIRT_TO_BUS 32 33 select ARCH_DISCARD_MEMBLOCK 33 34 select GENERIC_IRQ_PROBE
+1
arch/ia64/include/asm/Kbuild
··· 5 5 generic-y += kvm_para.h 6 6 generic-y += mcs_spinlock.h 7 7 generic-y += preempt.h 8 + generic-y += scatterlist.h 8 9 generic-y += trace_clock.h 9 10 generic-y += vtime.h
-7
arch/ia64/include/asm/scatterlist.h
··· 1 - #ifndef _ASM_IA64_SCATTERLIST_H 2 - #define _ASM_IA64_SCATTERLIST_H 3 - 4 - #include <asm-generic/scatterlist.h> 5 - #define ARCH_HAS_SG_CHAIN 6 - 7 - #endif /* _ASM_IA64_SCATTERLIST_H */
+1
arch/powerpc/Kconfig
··· 111 111 select HAVE_DMA_API_DEBUG 112 112 select HAVE_OPROFILE 113 113 select HAVE_DEBUG_KMEMLEAK 114 + select ARCH_HAS_SG_CHAIN 114 115 select GENERIC_ATOMIC64 if PPC32 115 116 select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE 116 117 select HAVE_PERF_EVENTS
+1
arch/powerpc/include/asm/Kbuild
··· 4 4 generic-y += mcs_spinlock.h 5 5 generic-y += preempt.h 6 6 generic-y += rwsem.h 7 + generic-y += scatterlist.h 7 8 generic-y += trace_clock.h 8 9 generic-y += vtime.h
-17
arch/powerpc/include/asm/scatterlist.h
··· 1 - #ifndef _ASM_POWERPC_SCATTERLIST_H 2 - #define _ASM_POWERPC_SCATTERLIST_H 3 - /* 4 - * Copyright (C) 2001 PPC64 Team, IBM Corp 5 - * 6 - * This program is free software; you can redistribute it and/or 7 - * modify it under the terms of the GNU General Public License 8 - * as published by the Free Software Foundation; either version 9 - * 2 of the License, or (at your option) any later version. 10 - */ 11 - 12 - #include <asm/dma.h> 13 - #include <asm-generic/scatterlist.h> 14 - 15 - #define ARCH_HAS_SG_CHAIN 16 - 17 - #endif /* _ASM_POWERPC_SCATTERLIST_H */
+1
arch/powerpc/mm/dma-noncoherent.c
··· 33 33 #include <linux/export.h> 34 34 35 35 #include <asm/tlbflush.h> 36 + #include <asm/dma.h> 36 37 37 38 #include "mmu_decl.h" 38 39
+1
arch/powerpc/platforms/44x/warp.c
··· 25 25 #include <asm/time.h> 26 26 #include <asm/uic.h> 27 27 #include <asm/ppc4xx.h> 28 + #include <asm/dma.h> 28 29 29 30 30 31 static __initdata struct of_device_id warp_of_bus[] = {
+1
arch/powerpc/platforms/52xx/efika.c
··· 13 13 #include <generated/utsrelease.h> 14 14 #include <linux/pci.h> 15 15 #include <linux/of.h> 16 + #include <asm/dma.h> 16 17 #include <asm/prom.h> 17 18 #include <asm/time.h> 18 19 #include <asm/machdep.h>
+1
arch/powerpc/platforms/amigaone/setup.c
··· 24 24 #include <asm/i8259.h> 25 25 #include <asm/time.h> 26 26 #include <asm/udbg.h> 27 + #include <asm/dma.h> 27 28 28 29 extern void __flush_disable_L1(void); 29 30
+1
arch/s390/Kconfig
··· 145 145 select TTY 146 146 select VIRT_CPU_ACCOUNTING 147 147 select VIRT_TO_BUS 148 + select ARCH_HAS_SG_CHAIN 148 149 149 150 config SCHED_OMIT_FRAME_POINTER 150 151 def_bool y
+1
arch/s390/include/asm/Kbuild
··· 4 4 generic-y += hash.h 5 5 generic-y += mcs_spinlock.h 6 6 generic-y += preempt.h 7 + generic-y += scatterlist.h 7 8 generic-y += trace_clock.h
-3
arch/s390/include/asm/scatterlist.h
··· 1 - #include <asm-generic/scatterlist.h> 2 - 3 - #define ARCH_HAS_SG_CHAIN
+1
arch/sparc/Kconfig
··· 42 42 select MODULES_USE_ELF_RELA 43 43 select ODD_RT_SIGACTION 44 44 select OLD_SIGSUSPEND 45 + select ARCH_HAS_SG_CHAIN 45 46 46 47 config SPARC32 47 48 def_bool !64BIT
+1
arch/sparc/include/asm/Kbuild
··· 15 15 generic-y += module.h 16 16 generic-y += mutex.h 17 17 generic-y += preempt.h 18 + generic-y += scatterlist.h 18 19 generic-y += serial.h 19 20 generic-y += trace_clock.h 20 21 generic-y += types.h
-8
arch/sparc/include/asm/scatterlist.h
··· 1 - #ifndef _SPARC_SCATTERLIST_H 2 - #define _SPARC_SCATTERLIST_H 3 - 4 - #include <asm-generic/scatterlist.h> 5 - 6 - #define ARCH_HAS_SG_CHAIN 7 - 8 - #endif /* !(_SPARC_SCATTERLIST_H) */
+1
arch/um/include/asm/Kbuild
··· 21 21 generic-y += pci.h 22 22 generic-y += percpu.h 23 23 generic-y += preempt.h 24 + generic-y += scatterlist.h 24 25 generic-y += sections.h 25 26 generic-y += switch_to.h 26 27 generic-y += topology.h
+1
arch/x86/Kconfig
··· 96 96 select IRQ_FORCED_THREADING 97 97 select HAVE_BPF_JIT if X86_64 98 98 select HAVE_ARCH_TRANSPARENT_HUGEPAGE 99 + select ARCH_HAS_SG_CHAIN 99 100 select CLKEVT_I8253 100 101 select ARCH_HAVE_NMI_SAFE_CMPXCHG 101 102 select GENERIC_IOMAP
+2 -1
arch/x86/include/asm/Kbuild
··· 5 5 genhdr-y += unistd_x32.h 6 6 7 7 generic-y += clkdev.h 8 - generic-y += early_ioremap.h 9 8 generic-y += cputime.h 9 + generic-y += early_ioremap.h 10 10 generic-y += mcs_spinlock.h 11 + generic-y += scatterlist.h
-8
arch/x86/include/asm/scatterlist.h
··· 1 - #ifndef _ASM_X86_SCATTERLIST_H 2 - #define _ASM_X86_SCATTERLIST_H 3 - 4 - #include <asm-generic/scatterlist.h> 5 - 6 - #define ARCH_HAS_SG_CHAIN 7 - 8 - #endif /* _ASM_X86_SCATTERLIST_H */
+1 -1
include/linux/scatterlist.h
··· 136 136 static inline void sg_chain(struct scatterlist *prv, unsigned int prv_nents, 137 137 struct scatterlist *sgl) 138 138 { 139 - #ifndef ARCH_HAS_SG_CHAIN 139 + #ifndef CONFIG_ARCH_HAS_SG_CHAIN 140 140 BUG(); 141 141 #endif 142 142
+1 -1
include/scsi/scsi.h
··· 31 31 * Like SCSI_MAX_SG_SEGMENTS, but for archs that have sg chaining. This limit 32 32 * is totally arbitrary, a setting of 2048 will get you at least 8mb ios. 33 33 */ 34 - #ifdef ARCH_HAS_SG_CHAIN 34 + #ifdef CONFIG_ARCH_HAS_SG_CHAIN 35 35 #define SCSI_MAX_SG_CHAIN_SEGMENTS 2048 36 36 #else 37 37 #define SCSI_MAX_SG_CHAIN_SEGMENTS SCSI_MAX_SG_SEGMENTS
+7
lib/Kconfig
··· 508 508 509 509 source "lib/fonts/Kconfig" 510 510 511 + # 512 + # sg chaining option 513 + # 514 + 515 + config ARCH_HAS_SG_CHAIN 516 + def_bool n 517 + 511 518 endmenu
+2 -2
lib/scatterlist.c
··· 73 73 **/ 74 74 struct scatterlist *sg_last(struct scatterlist *sgl, unsigned int nents) 75 75 { 76 - #ifndef ARCH_HAS_SG_CHAIN 76 + #ifndef CONFIG_ARCH_HAS_SG_CHAIN 77 77 struct scatterlist *ret = &sgl[nents - 1]; 78 78 #else 79 79 struct scatterlist *sg, *ret = NULL; ··· 255 255 256 256 if (nents == 0) 257 257 return -EINVAL; 258 - #ifndef ARCH_HAS_SG_CHAIN 258 + #ifndef CONFIG_ARCH_HAS_SG_CHAIN 259 259 if (WARN_ON_ONCE(nents > max_ents)) 260 260 return -EINVAL; 261 261 #endif