diff options
| author | Laura Abbott <lauraa@codeaurora.org> | 2014-08-08 17:23:25 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-08 18:57:26 -0400 |
| commit | 308c09f17da4adc53935115dbeb5bce4f067d8f9 (patch) | |
| tree | 1f1387d4db16df4ea416d640fd28269ea92a5827 /lib | |
| parent | 2f137d66fb65ef41df6e558f23d481f07394a424 (diff) | |
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>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Kconfig | 7 | ||||
| -rw-r--r-- | lib/scatterlist.c | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/lib/Kconfig b/lib/Kconfig index df872659ddd3..a5ce0c7f6c30 100644 --- a/lib/Kconfig +++ b/lib/Kconfig | |||
| @@ -508,4 +508,11 @@ config UCS2_STRING | |||
| 508 | 508 | ||
| 509 | source "lib/fonts/Kconfig" | 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 | endmenu | 518 | endmenu |
diff --git a/lib/scatterlist.c b/lib/scatterlist.c index b4415fceb7e7..9cdf62f8accd 100644 --- a/lib/scatterlist.c +++ b/lib/scatterlist.c | |||
| @@ -73,7 +73,7 @@ EXPORT_SYMBOL(sg_nents); | |||
| 73 | **/ | 73 | **/ |
| 74 | struct scatterlist *sg_last(struct scatterlist *sgl, unsigned int nents) | 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 | struct scatterlist *ret = &sgl[nents - 1]; | 77 | struct scatterlist *ret = &sgl[nents - 1]; |
| 78 | #else | 78 | #else |
| 79 | struct scatterlist *sg, *ret = NULL; | 79 | struct scatterlist *sg, *ret = NULL; |
| @@ -255,7 +255,7 @@ int __sg_alloc_table(struct sg_table *table, unsigned int nents, | |||
| 255 | 255 | ||
| 256 | if (nents == 0) | 256 | if (nents == 0) |
| 257 | return -EINVAL; | 257 | return -EINVAL; |
| 258 | #ifndef ARCH_HAS_SG_CHAIN | 258 | #ifndef CONFIG_ARCH_HAS_SG_CHAIN |
| 259 | if (WARN_ON_ONCE(nents > max_ents)) | 259 | if (WARN_ON_ONCE(nents > max_ents)) |
| 260 | return -EINVAL; | 260 | return -EINVAL; |
| 261 | #endif | 261 | #endif |
