|
@@ -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));
|