mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-19 21:07:12 +07:00
BUG_ON() Conversion in mm/mmap.c
this changes if() BUG(); constructs to BUG_ON() which is cleaner, contains unlikely() and can better optimized away. Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> Signed-off-by: Adrian Bunk <bunk@stusta.de>
This commit is contained in:
parent
8abd8e298e
commit
46a350ef98
@ -294,8 +294,7 @@ void validate_mm(struct mm_struct *mm)
|
|||||||
i = browse_rb(&mm->mm_rb);
|
i = browse_rb(&mm->mm_rb);
|
||||||
if (i != mm->map_count)
|
if (i != mm->map_count)
|
||||||
printk("map_count %d rb %d\n", mm->map_count, i), bug = 1;
|
printk("map_count %d rb %d\n", mm->map_count, i), bug = 1;
|
||||||
if (bug)
|
BUG_ON(bug);
|
||||||
BUG();
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#define validate_mm(mm) do { } while (0)
|
#define validate_mm(mm) do { } while (0)
|
||||||
@ -432,8 +431,7 @@ __insert_vm_struct(struct mm_struct * mm, struct vm_area_struct * vma)
|
|||||||
struct rb_node ** rb_link, * rb_parent;
|
struct rb_node ** rb_link, * rb_parent;
|
||||||
|
|
||||||
__vma = find_vma_prepare(mm, vma->vm_start,&prev, &rb_link, &rb_parent);
|
__vma = find_vma_prepare(mm, vma->vm_start,&prev, &rb_link, &rb_parent);
|
||||||
if (__vma && __vma->vm_start < vma->vm_end)
|
BUG_ON(__vma && __vma->vm_start < vma->vm_end);
|
||||||
BUG();
|
|
||||||
__vma_link(mm, vma, prev, rb_link, rb_parent);
|
__vma_link(mm, vma, prev, rb_link, rb_parent);
|
||||||
mm->map_count++;
|
mm->map_count++;
|
||||||
}
|
}
|
||||||
@ -813,8 +811,7 @@ struct anon_vma *find_mergeable_anon_vma(struct vm_area_struct *vma)
|
|||||||
* (e.g. stash info in next's anon_vma_node when assigning
|
* (e.g. stash info in next's anon_vma_node when assigning
|
||||||
* an anon_vma, or when trying vma_merge). Another time.
|
* an anon_vma, or when trying vma_merge). Another time.
|
||||||
*/
|
*/
|
||||||
if (find_vma_prev(vma->vm_mm, vma->vm_start, &near) != vma)
|
BUG_ON(find_vma_prev(vma->vm_mm, vma->vm_start, &near) != vma);
|
||||||
BUG();
|
|
||||||
if (!near)
|
if (!near)
|
||||||
goto none;
|
goto none;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user