diff options
author | Paul Mackerras <paulus@samba.org> | 2007-11-02 14:03:14 +1100 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-11-02 14:03:14 +1100 |
commit | 97a4649d6ffce4a5d7f5ce018d87a6cefcb4ad03 (patch) | |
tree | 8f7f591754baa934a842357e75e773a525bfb147 /include/linux/scatterlist.h | |
parent | [POWERPC] powerpc: Fix demotion of segments to 4K pages (diff) | |
parent | Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 (diff) | |
download | linux-dev-97a4649d6ffce4a5d7f5ce018d87a6cefcb4ad03.tar.xz linux-dev-97a4649d6ffce4a5d7f5ce018d87a6cefcb4ad03.zip |
Merge branch 'linux-2.6' into merge
Diffstat (limited to '')
-rw-r--r-- | include/linux/scatterlist.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h index 457123171389..32326c293d7b 100644 --- a/include/linux/scatterlist.h +++ b/include/linux/scatterlist.h @@ -150,7 +150,7 @@ static inline struct scatterlist *sg_last(struct scatterlist *sgl, struct scatterlist *ret = &sgl[nents - 1]; #else struct scatterlist *sg, *ret = NULL; - int i; + unsigned int i; for_each_sg(sgl, sg, nents, i) ret = sg; @@ -179,7 +179,11 @@ static inline void sg_chain(struct scatterlist *prv, unsigned int prv_nents, #ifndef ARCH_HAS_SG_CHAIN BUG(); #endif - prv[prv_nents - 1].page_link = (unsigned long) sgl | 0x01; + /* + * Set lowest bit to indicate a link pointer, and make sure to clear + * the termination bit if it happens to be set. + */ + prv[prv_nents - 1].page_link = ((unsigned long) sgl | 0x01) & ~0x02; } /** @@ -239,7 +243,7 @@ static inline void sg_init_table(struct scatterlist *sgl, unsigned int nents) sg_mark_end(sgl, nents); #ifdef CONFIG_DEBUG_SG { - int i; + unsigned int i; for (i = 0; i < nents; i++) sgl[i].sg_magic = SG_MAGIC; } |