summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-11-09 03:51:00 -0500
committerChristoph Hellwig <hch@lst.de>2018-12-06 10:04:56 -0500
commit7c703e54cc71df5baa962e24a5663d88173bba5c (patch)
treecaf54e62471ee960c1143a58d246d2e63bd35616 /lib
parentb14b9d25a3c707c85e7e31e15766a71365b52ab7 (diff)
arch: switch the default on ARCH_HAS_SG_CHAIN
These days architectures are mostly out of the business of dealing with struct scatterlist at all, unless they have architecture specific iommu drivers. Replace the ARCH_HAS_SG_CHAIN symbol with a ARCH_NO_SG_CHAIN one only enabled for architectures with horrible legacy iommu drivers like alpha and parisc, and conditionally for arm which wants to keep it disable for legacy platforms. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Kconfig2
-rw-r--r--lib/scatterlist.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/Kconfig b/lib/Kconfig
index a9965f4af4dd..d5a5e2ebf286 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -577,7 +577,7 @@ config SG_POOL
577# sg chaining option 577# sg chaining option
578# 578#
579 579
580config ARCH_HAS_SG_CHAIN 580config ARCH_NO_SG_CHAIN
581 def_bool n 581 def_bool n
582 582
583config ARCH_HAS_PMEM_API 583config ARCH_HAS_PMEM_API
diff --git a/lib/scatterlist.c b/lib/scatterlist.c
index 7c6096a71704..9ba349e775ef 100644
--- a/lib/scatterlist.c
+++ b/lib/scatterlist.c
@@ -271,7 +271,7 @@ int __sg_alloc_table(struct sg_table *table, unsigned int nents,
271 271
272 if (nents == 0) 272 if (nents == 0)
273 return -EINVAL; 273 return -EINVAL;
274#ifndef CONFIG_ARCH_HAS_SG_CHAIN 274#ifdef CONFIG_ARCH_NO_SG_CHAIN
275 if (WARN_ON_ONCE(nents > max_ents)) 275 if (WARN_ON_ONCE(nents > max_ents))
276 return -EINVAL; 276 return -EINVAL;
277#endif 277#endif