mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
[SG] Add debug check for page alignment
Suggested by Boaz Harrosh <bharrosh@panasas.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
This commit is contained in:
parent
0b776eb542
commit
de26103de5
1 changed files with 5 additions and 0 deletions
|
@ -41,6 +41,11 @@ static inline void sg_set_page(struct scatterlist *sg, struct page *page)
|
||||||
{
|
{
|
||||||
unsigned long page_link = sg->page_link & 0x3;
|
unsigned long page_link = sg->page_link & 0x3;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* In order for the low bit stealing approach to work, pages
|
||||||
|
* must be aligned at a 32-bit boundary as a minimum.
|
||||||
|
*/
|
||||||
|
BUG_ON((unsigned long) page & 0x03);
|
||||||
#ifdef CONFIG_DEBUG_SG
|
#ifdef CONFIG_DEBUG_SG
|
||||||
BUG_ON(sg->sg_magic != SG_MAGIC);
|
BUG_ON(sg->sg_magic != SG_MAGIC);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue