lib/scatterlist: Make ARCH_HAS_SG_CHAIN an actual Kconfig
Subsystems (10)
PATCH 1/2 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.
Cc: Russell King <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Fenghua Yu <[email protected]>
Benjamin Herrenschmidt <[email protected]>
Paul Mackerras <[email protected]>
--- arch/arm/Kconfig | 1 + arch/arm/include/asm/Kbuild | 1 + arch/arm/include/asm/scatterlist.h | 12 ------------ arch/arm64/Kconfig | 1 + arch/ia64/Kconfig | 1 + arch/ia64/include/asm/Kbuild | 1 + arch/ia64/include/asm/scatterlist.h | 7 ------- arch/powerpc/Kconfig | 1 + arch/powerpc/include/asm/Kbuild | 1 + arch/powerpc/include/asm/scatterlist.h | 17 ----------------- arch/s390/Kconfig | 1 + arch/s390/include/asm/Kbuild | 1 + arch/s390/include/asm/scatterlist.h | 3 --- arch/sparc/Kconfig | 1 + arch/sparc/include/asm/Kbuild | 1 + arch/sparc/include/asm/scatterlist.h | 8 -------- arch/x86/Kconfig | 1 + arch/x86/include/asm/Kbuild | 1 + arch/x86/include/asm/scatterlist.h | 8 -------- include/linux/scatterlist.h | 2 +- include/scsi/scsi.h | 2 +- lib/Kconfig | 7 +++++++ lib/scatterlist.c | 4 ++-- 23 files changed, 24 insertions(+), 59 deletions(-) delete mode 100644 arch/arm/include/asm/scatterlist.h delete mode 100644 arch/ia64/include/asm/scatterlist.h delete mode 100644 arch/powerpc/include/asm/scatterlist.h delete mode 100644 arch/s390/include/asm/scatterlist.h delete mode 100644 arch/sparc/include/asm/scatterlist.h delete mode 100644 arch/x86/include/asm/scatterlist.h
arch/arm/Kconfig +1 -0
@@ -82,6 +82,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
arch/arm/include/asm/Kbuild +1 -0
@@ -18,6 +18,7 @@ generic-y += param.h generic-y += parport.h generic-y += poll.h generic-y += resource.h +generic-y += scatterlist.h generic-y += sections.h generic-y += segment.h generic-y += sembuf.h
arch/arm/include/asm/scatterlist.h deleted +0 -12
@@ -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 */
arch/arm64/Kconfig +1 -0
@@ -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
arch/ia64/Kconfig +1 -0
@@ -44,6 +44,7 @@ config IA64 select HAVE_MOD_ARCH_SPECIFIC select MODULES_USE_ELF_RELA select ARCH_USE_CMPXCHG_LOCKREF + select ARCH_HAS_SG_CHAIN default y help The Itanium Processor Family is Intel's 64-bit successor to
arch/ia64/include/asm/Kbuild +1 -0
@@ -2,6 +2,7 @@ generic-y += clkdev.h generic-y += exec.h generic-y += kvm_para.h +generic-y += scatterlist.h generic-y += trace_clock.h generic-y += preempt.h generic-y += vtime.h
arch/ia64/include/asm/scatterlist.h deleted +0 -7
@@ -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 */
arch/powerpc/Kconfig +1 -0
@@ -141,6 +141,7 @@ config PPC select HAVE_DEBUG_STACKOVERFLOW select HAVE_IRQ_EXIT_ON_IRQ_STACK select ARCH_USE_CMPXCHG_LOCKREF if PPC64 + select ARCH_HAS_SG_CHAIN config GENERIC_CSUM def_bool CPU_LITTLE_ENDIAN
arch/powerpc/include/asm/Kbuild +1 -0
@@ -1,6 +1,7 @@ generic-y += clkdev.h generic-y += rwsem.h +generic-y += scatterlist.h generic-y += trace_clock.h generic-y += preempt.h generic-y += vtime.h
arch/powerpc/include/asm/scatterlist.h deleted +0 -17
@@ -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 */
arch/s390/Kconfig +1 -0
@@ -142,6 +142,7 @@ config S390 select SYSCTL_EXCEPTION_TRACE select VIRT_CPU_ACCOUNTING select VIRT_TO_BUS + select ARCH_HAS_SG_CHAIN config SCHED_OMIT_FRAME_POINTER def_bool y
arch/s390/include/asm/Kbuild +1 -0
@@ -4,3 +4,4 @@ generic-y += clkdev.h generic-y += trace_clock.h generic-y += preempt.h generic-y += hash.h +generic-y += scatterlist.h
arch/s390/include/asm/scatterlist.h deleted +0 -3
@@ -1,3 +0,0 @@ -#include <asm-generic/scatterlist.h> - -#define ARCH_HAS_SG_CHAIN
arch/sparc/Kconfig +1 -0
@@ -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
arch/sparc/include/asm/Kbuild +1 -0
@@ -18,3 +18,4 @@ generic-y += types.h generic-y += word-at-a-time.h generic-y += preempt.h generic-y += hash.h +generic-y += scatterlist.h
arch/sparc/include/asm/scatterlist.h deleted +0 -8
@@ -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) */
arch/x86/Kconfig +1 -0
@@ -127,6 +127,7 @@ config X86 select HAVE_DEBUG_STACKOVERFLOW select HAVE_IRQ_EXIT_ON_IRQ_STACK if X86_64 select HAVE_CC_STACKPROTECTOR + select ARCH_HAS_SG_CHAIN config INSTRUCTION_DECODER def_bool y
arch/x86/include/asm/Kbuild +1 -0
@@ -5,3 +5,4 @@ genhdr-y += unistd_64.h genhdr-y += unistd_x32.h generic-y += clkdev.h +generic-y += scatterlist.h
arch/x86/include/asm/scatterlist.h deleted +0 -8
@@ -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 */
include/linux/scatterlist.h +1 -1
@@ -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
include/scsi/scsi.h +1 -1
@@ -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
lib/Kconfig +7 -0
@@ -451,4 +451,11 @@ config UCS2_STRING source "lib/fonts/Kconfig" +# +# sg chaining option +# + +config ARCH_HAS_SG_CHAIN + def_bool n + endmenu
lib/scatterlist.c +2 -2
@@ -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
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
PATCH 2/2 Cleanup useless architecture versions of scatterlist.h
There's no need to have an architecture version of scatterlist.h if the only thing the file does is include asm-generic/scatterlist.h. Switch to the asm-generic versions directly.
--- arch/alpha/include/asm/Kbuild | 1 + arch/alpha/include/asm/scatterlist.h | 6 ------ arch/cris/include/asm/Kbuild | 1 + arch/cris/include/asm/scatterlist.h | 6 ------ arch/frv/include/asm/Kbuild | 1 + arch/frv/include/asm/scatterlist.h | 6 ------ arch/m32r/include/asm/Kbuild | 1 + arch/m32r/include/asm/scatterlist.h | 6 ------ arch/microblaze/include/asm/Kbuild | 1 + arch/microblaze/include/asm/scatterlist.h | 1 - arch/mn10300/include/asm/Kbuild | 1 + arch/mn10300/include/asm/scatterlist.h | 16 ---------------- arch/score/include/asm/Kbuild | 2 +- arch/score/include/asm/scatterlist.h | 6 ------ 14 files changed, 7 insertions(+), 48 deletions(-) delete mode 100644 arch/alpha/include/asm/scatterlist.h delete mode 100644 arch/cris/include/asm/scatterlist.h delete mode 100644 arch/frv/include/asm/scatterlist.h delete mode 100644 arch/m32r/include/asm/scatterlist.h delete mode 100644 arch/microblaze/include/asm/scatterlist.h delete mode 100644 arch/mn10300/include/asm/scatterlist.h delete mode 100644 arch/score/include/asm/scatterlist.h
arch/alpha/include/asm/Kbuild +1 -0
@@ -5,3 +5,4 @@ generic-y += exec.h generic-y += trace_clock.h generic-y += preempt.h generic-y += hash.h +generic-y += scatterlist.h
arch/alpha/include/asm/scatterlist.h deleted +0 -6
@@ -1,6 +0,0 @@ -#ifndef _ALPHA_SCATTERLIST_H -#define _ALPHA_SCATTERLIST_H - -#include <asm-generic/scatterlist.h> - -#endif /* !(_ALPHA_SCATTERLIST_H) */
arch/cris/include/asm/Kbuild +1 -0
@@ -14,3 +14,4 @@ generic-y += trace_clock.h generic-y += vga.h generic-y += xor.h generic-y += preempt.h +generic-y += scatterlist.h
arch/cris/include/asm/scatterlist.h deleted +0 -6
@@ -1,6 +0,0 @@ -#ifndef __ASM_CRIS_SCATTERLIST_H -#define __ASM_CRIS_SCATTERLIST_H - -#include <asm-generic/scatterlist.h> - -#endif /* !(__ASM_CRIS_SCATTERLIST_H) */
arch/frv/include/asm/Kbuild +1 -0
@@ -4,3 +4,4 @@ generic-y += exec.h generic-y += trace_clock.h generic-y += preempt.h generic-y += hash.h +generic-y += scatterlist.h
arch/frv/include/asm/scatterlist.h deleted +0 -6
@@ -1,6 +0,0 @@ -#ifndef _ASM_SCATTERLIST_H -#define _ASM_SCATTERLIST_H - -#include <asm-generic/scatterlist.h> - -#endif /* !_ASM_SCATTERLIST_H */
arch/m32r/include/asm/Kbuild +1 -0
@@ -2,6 +2,7 @@ generic-y += clkdev.h generic-y += exec.h generic-y += module.h +generic-y += scatterlist.h generic-y += trace_clock.h generic-y += preempt.h generic-y += hash.h
arch/m32r/include/asm/scatterlist.h deleted +0 -6
@@ -1,6 +0,0 @@ -#ifndef _ASM_M32R_SCATTERLIST_H -#define _ASM_M32R_SCATTERLIST_H - -#include <asm-generic/scatterlist.h> - -#endif /* _ASM_M32R_SCATTERLIST_H */
arch/microblaze/include/asm/Kbuild +1 -0
@@ -4,5 +4,6 @@ generic-y += clkdev.h generic-y += exec.h generic-y += hash.h generic-y += trace_clock.h +generic-y += scatterlist.h generic-y += syscalls.h generic-y += preempt.h
arch/microblaze/include/asm/scatterlist.h deleted +0 -1
@@ -1 +0,0 @@ -#include <asm-generic/scatterlist.h>
arch/mn10300/include/asm/Kbuild +1 -0
@@ -3,5 +3,6 @@ generic-y += barrier.h generic-y += clkdev.h generic-y += exec.h generic-y += hash.h +generic-y += scatterlist.h generic-y += trace_clock.h generic-y += preempt.h
arch/mn10300/include/asm/scatterlist.h deleted +0 -16
@@ -1,16 +0,0 @@ -/* MN10300 Scatterlist definitions -* -* Copyright (C) 2007 Matsushita Electric Industrial Co., Ltd. -* Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public Licence -* as published by the Free Software Foundation; either version -* 2 of the Licence, or (at your option) any later version. -*/ -#ifndef _ASM_SCATTERLIST_H -#define _ASM_SCATTERLIST_H - -#include <asm-generic/scatterlist.h> - -#endif /* _ASM_SCATTERLIST_H */
arch/score/include/asm/Kbuild +1 -1
@@ -7,4 +7,4 @@ generic-y += hash.h generic-y += trace_clock.h generic-y += xor.h generic-y += preempt.h - +generic-y += scatterlist.h
arch/score/include/asm/scatterlist.h deleted +0 -6
@@ -1,6 +0,0 @@ -#ifndef _ASM_SCORE_SCATTERLIST_H -#define _ASM_SCORE_SCATTERLIST_H - -#include <asm-generic/scatterlist.h> - -#endif /* _ASM_SCORE_SCATTERLIST_H */
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
Re: [PATCH 2/2] Cleanup useless architecture versions of scatterlist.h
Quoted 5 lines · Laura Abbott
There's no need to have an architecture version of
scatterlist.hif the only thing the file does is includeasm-generic/scatterlist.h. Switch to the asm-generic versions directly.Cc Mikael Starvik <[email protected]>
For the CRIS-part:
Quoted 8 lines
Cc David Howells <[email protected]>Cc Hirokazu Takata <[email protected]>,Cc Michal Simek <[email protected]>Cc David Howells <[email protected]>Cc Koichi Yasutake <[email protected]>Cc Chen Liqin <[email protected]>,Cc Lennox Wu <[email protected]>Signed-off-by Laura Abbott <[email protected]>
/^JN - Jesper Nilsson
Signature · 1 line
Jesper Nilsson -- [email protected]
Re: [PATCH 2/2] Cleanup useless architecture versions of scatterlist.h
In reply to Laura AbbottQuoted 3 lines · Laura Abbott
There's no need to have an architecture version of
scatterlist.hif the only thing the file does is includeasm-generic/scatterlist.h. Switch to the asm-generic versions directly.