diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-29 10:49:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-29 10:49:10 -0400 |
commit | 20dc9f01a867318ac0bc3ea9185d71f05076aeb0 (patch) | |
tree | f8e9528f1fd926b9f7fba9618b602d711cbfcaa8 /include | |
parent | 93400708dba888d45b4da01e1753a3a743f44496 (diff) | |
parent | e1efa2a3ea266e093f690c20af7522d95540f74f (diff) |
Merge branch 'sg' of git://git.kernel.dk/linux-2.6-block
* 'sg' of git://git.kernel.dk/linux-2.6-block:
Correction of "Update drivers to use sg helpers" patch for IMXMMC driver
sg_init_table() should use unsigned loop index variable
sg_last() should use unsigned loop index variable
Initialise scatter/gather list in sg driver
Initialise scatter/gather list in ata_sg_setup
x86: fix pci-gart failure handling
SG: s390-scsi: missing size parameter in zfcp_address_to_sg()
SG: clear termination bit in sg_chain()
Diffstat (limited to 'include')
-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, | |||
150 | struct scatterlist *ret = &sgl[nents - 1]; | 150 | struct scatterlist *ret = &sgl[nents - 1]; |
151 | #else | 151 | #else |
152 | struct scatterlist *sg, *ret = NULL; | 152 | struct scatterlist *sg, *ret = NULL; |
153 | int i; | 153 | unsigned int i; |
154 | 154 | ||
155 | for_each_sg(sgl, sg, nents, i) | 155 | for_each_sg(sgl, sg, nents, i) |
156 | ret = sg; | 156 | ret = sg; |
@@ -179,7 +179,11 @@ static inline void sg_chain(struct scatterlist *prv, unsigned int prv_nents, | |||
179 | #ifndef ARCH_HAS_SG_CHAIN | 179 | #ifndef ARCH_HAS_SG_CHAIN |
180 | BUG(); | 180 | BUG(); |
181 | #endif | 181 | #endif |
182 | prv[prv_nents - 1].page_link = (unsigned long) sgl | 0x01; | 182 | /* |
183 | * Set lowest bit to indicate a link pointer, and make sure to clear | ||
184 | * the termination bit if it happens to be set. | ||
185 | */ | ||
186 | prv[prv_nents - 1].page_link = ((unsigned long) sgl | 0x01) & ~0x02; | ||
183 | } | 187 | } |
184 | 188 | ||
185 | /** | 189 | /** |
@@ -239,7 +243,7 @@ static inline void sg_init_table(struct scatterlist *sgl, unsigned int nents) | |||
239 | sg_mark_end(sgl, nents); | 243 | sg_mark_end(sgl, nents); |
240 | #ifdef CONFIG_DEBUG_SG | 244 | #ifdef CONFIG_DEBUG_SG |
241 | { | 245 | { |
242 | int i; | 246 | unsigned int i; |
243 | for (i = 0; i < nents; i++) | 247 | for (i = 0; i < nents; i++) |
244 | sgl[i].sg_magic = SG_MAGIC; | 248 | sgl[i].sg_magic = SG_MAGIC; |
245 | } | 249 | } |