summaryrefslogtreecommitdiffstats
path: root/lib/scatterlist.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2015-08-07 18:15:11 +0200
committerJens Axboe <axboe@fb.com>2015-08-17 08:12:51 -0600
commit10c95ed9aa2970e05fedb4ac8b3ce1b934dab17b (patch)
tree1d95c738627ea9d01c90e831a5676766458444c0 /lib/scatterlist.c
parent0048b4837affd153897ed1222283492070027aa9 (diff)
downloadlinux-10c95ed9aa2970e05fedb4ac8b3ce1b934dab17b.tar.gz
linux-10c95ed9aa2970e05fedb4ac8b3ce1b934dab17b.tar.bz2
linux-10c95ed9aa2970e05fedb4ac8b3ce1b934dab17b.zip
scatterlist: allow limited chaining without ARCH_HAS_SG_CHAIN
There are a couple of uses of struct scatterlist that never go to the dma_map_sg() helper and thus don't care about ARCH_HAS_SG_CHAIN which indicates that we can map chained S/G list. The most important one is the crypto code, which currently has to open code a few helpers to always allow chaining. This patch removes a few #ifdef ARCH_HAS_SG_CHAIN statements so that we can switch the crypto code to these common helpers. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'lib/scatterlist.c')
-rw-r--r--lib/scatterlist.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/lib/scatterlist.c b/lib/scatterlist.c
index d105a9f56878..bafa9933fa76 100644
--- a/lib/scatterlist.c
+++ b/lib/scatterlist.c
@@ -105,16 +105,12 @@ EXPORT_SYMBOL(sg_nents_for_len);
**/
struct scatterlist *sg_last(struct scatterlist *sgl, unsigned int nents)
{
-#ifndef CONFIG_ARCH_HAS_SG_CHAIN
- struct scatterlist *ret = &sgl[nents - 1];
-#else
struct scatterlist *sg, *ret = NULL;
unsigned int i;
for_each_sg(sgl, sg, nents, i)
ret = sg;
-#endif
#ifdef CONFIG_DEBUG_SG
BUG_ON(sgl[0].sg_magic != SG_MAGIC);
BUG_ON(!sg_is_last(ret));