[CRYPTO] digest: Added user API for new hash type
[safe/jmp/linux-2.6] / crypto / scatterwalk.h
index ace595a..f1592cc 100644 (file)
 
 #include "internal.h"
 
-/* Define sg_next is an inline routine now in case we want to change
-   scatterlist to a linked list later. */
 static inline struct scatterlist *sg_next(struct scatterlist *sg)
 {
-       return sg + 1;
+       return (++sg)->length ? sg : (void *)sg->page;
 }
 
 static inline unsigned long scatterwalk_samebuf(struct scatter_walk *walk_in,