|
@@ -36,7 +36,6 @@ static inline void sg_assign_page(struct scatterlist *sg, struct page *page)
|
|
*/
|
|
*/
|
|
BUG_ON((unsigned long) page & 0x03);
|
|
BUG_ON((unsigned long) page & 0x03);
|
|
#ifdef CONFIG_DEBUG_SG
|
|
#ifdef CONFIG_DEBUG_SG
|
|
- BUG_ON(sg->sg_magic != SG_MAGIC);
|
|
|
|
BUG_ON(sg_is_chain(sg));
|
|
BUG_ON(sg_is_chain(sg));
|
|
#endif
|
|
#endif
|
|
sg->page_link = page_link | (unsigned long) page;
|
|
sg->page_link = page_link | (unsigned long) page;
|
|
@@ -67,7 +66,6 @@ static inline void sg_set_page(struct scatterlist *sg, struct page *page,
|
|
static inline struct page *sg_page(struct scatterlist *sg)
|
|
static inline struct page *sg_page(struct scatterlist *sg)
|
|
{
|
|
{
|
|
#ifdef CONFIG_DEBUG_SG
|
|
#ifdef CONFIG_DEBUG_SG
|
|
- BUG_ON(sg->sg_magic != SG_MAGIC);
|
|
|
|
BUG_ON(sg_is_chain(sg));
|
|
BUG_ON(sg_is_chain(sg));
|
|
#endif
|
|
#endif
|
|
return (struct page *)((sg)->page_link & ~0x3);
|
|
return (struct page *)((sg)->page_link & ~0x3);
|
|
@@ -116,9 +114,6 @@ static inline void sg_chain(struct scatterlist *prv, unsigned int prv_nents,
|
|
**/
|
|
**/
|
|
static inline void sg_mark_end(struct scatterlist *sg)
|
|
static inline void sg_mark_end(struct scatterlist *sg)
|
|
{
|
|
{
|
|
-#ifdef CONFIG_DEBUG_SG
|
|
|
|
- BUG_ON(sg->sg_magic != SG_MAGIC);
|
|
|
|
-#endif
|
|
|
|
/*
|
|
/*
|
|
* Set termination bit, clear potential chain bit
|
|
* Set termination bit, clear potential chain bit
|
|
*/
|
|
*/
|
|
@@ -136,17 +131,11 @@ static inline void sg_mark_end(struct scatterlist *sg)
|
|
**/
|
|
**/
|
|
static inline void sg_unmark_end(struct scatterlist *sg)
|
|
static inline void sg_unmark_end(struct scatterlist *sg)
|
|
{
|
|
{
|
|
-#ifdef CONFIG_DEBUG_SG
|
|
|
|
- BUG_ON(sg->sg_magic != SG_MAGIC);
|
|
|
|
-#endif
|
|
|
|
sg->page_link &= ~0x02;
|
|
sg->page_link &= ~0x02;
|
|
}
|
|
}
|
|
|
|
|
|
static inline struct scatterlist *sg_next(struct scatterlist *sg)
|
|
static inline struct scatterlist *sg_next(struct scatterlist *sg)
|
|
{
|
|
{
|
|
-#ifdef CONFIG_DEBUG_SG
|
|
|
|
- BUG_ON(sg->sg_magic != SG_MAGIC);
|
|
|
|
-#endif
|
|
|
|
if (sg_is_last(sg))
|
|
if (sg_is_last(sg))
|
|
return NULL;
|
|
return NULL;
|
|
|
|
|
|
@@ -160,13 +149,6 @@ static inline struct scatterlist *sg_next(struct scatterlist *sg)
|
|
static inline void sg_init_table(struct scatterlist *sgl, unsigned int nents)
|
|
static inline void sg_init_table(struct scatterlist *sgl, unsigned int nents)
|
|
{
|
|
{
|
|
memset(sgl, 0, sizeof(*sgl) * nents);
|
|
memset(sgl, 0, sizeof(*sgl) * nents);
|
|
-#ifdef CONFIG_DEBUG_SG
|
|
|
|
- {
|
|
|
|
- unsigned int i;
|
|
|
|
- for (i = 0; i < nents; i++)
|
|
|
|
- sgl[i].sg_magic = SG_MAGIC;
|
|
|
|
- }
|
|
|
|
-#endif
|
|
|
|
sg_mark_end(&sgl[nents - 1]);
|
|
sg_mark_end(&sgl[nents - 1]);
|
|
}
|
|
}
|
|
|
|
|