From 5a6024c85947dcf13987f1da4320b49b4f1f620f Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Sat, 16 Feb 2013 04:09:11 +0000 Subject: [PATCH] Follow-up for the previous commit git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4762 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/scst.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/scst/include/scst.h b/scst/include/scst.h index f3c6f062c..47e965877 100644 --- a/scst/include/scst.h +++ b/scst/include/scst.h @@ -3737,12 +3737,6 @@ static inline void sg_set_page(struct scatterlist *sg, struct page *page, sg->length = len; } -#ifndef for_each_sg -/* See also commit 96b418c960af0d5c7185ff5c4af9376eb37ac9d3 */ -#define for_each_sg(sglist, sg, nr, __i) \ - for (__i = 0, sg = (sglist); __i < (nr); __i++, sg = sg_next(sg)) -#endif - #endif /* __BACKPORT_LINUX_SCATTERLIST_H_TO_2_6_23__ */ #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) */ @@ -3756,6 +3750,18 @@ static inline struct scatterlist *sg_next_inline(struct scatterlist *sg) return sg; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) +#ifndef __BACKPORT_LINUX_SCATTERLIST_H_TO_2_6_23__ + +#ifndef for_each_sg +/* See also commit 96b418c960af0d5c7185ff5c4af9376eb37ac9d3 */ +#define for_each_sg(sglist, sg, nr, __i) \ + for (__i = 0, sg = (sglist); __i < (nr); __i++, sg = sg_next_inline(sg)) +#endif + +#endif /* __BACKPORT_LINUX_SCATTERLIST_H_TO_2_6_23__ */ +#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) */ + static inline void sg_clear(struct scatterlist *sg) { memset(sg, 0, sizeof(*sg));