The patch titled Subject: mm/mmap.c: replace if (cond) BUG() with BUG_ON() has been removed from the -mm tree. Its filename was mm-mmap-replace-if-cond-bug-with-bug_on.patch This patch was dropped because it was nacked ------------------------------------------------------ From: Alex Shi <alex.shi@xxxxxxxxxxxxxxxxx> Subject: mm/mmap.c: replace if (cond) BUG() with BUG_ON() coccinelle reports some warnings: WARNING: Use BUG_ON instead of if condition followed by BUG. It could be fixed by BUG_ON(). Link: https://lkml.kernel.org/r/e50574aa-87b8-8ddf-2235-ef98e22bcb7d@xxxxxxxxxxxxxxxxx Reported-by: abaci@xxxxxxxxxxxxxxxxx Signed-off-by: Alex Shi <alex.shi@xxxxxxxxxxxxxxxxx> Acked-by: Minchan Kim <minchan@xxxxxxxxxx> Cc: Hugh Dickins <hughd@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/mmap.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) --- a/mm/mmap.c~mm-mmap-replace-if-cond-bug-with-bug_on +++ a/mm/mmap.c @@ -710,9 +710,8 @@ static void __insert_vm_struct(struct mm struct vm_area_struct *prev; struct rb_node **rb_link, *rb_parent; - if (find_vma_links(mm, vma->vm_start, vma->vm_end, - &prev, &rb_link, &rb_parent)) - BUG(); + BUG_ON(find_vma_links(mm, vma->vm_start, vma->vm_end, + &prev, &rb_link, &rb_parent)); __vma_link(mm, vma, prev, rb_link, rb_parent); mm->map_count++; } @@ -3569,9 +3568,8 @@ static void vm_lock_anon_vma(struct mm_s * can't change from under us thanks to the * anon_vma->root->rwsem. */ - if (__test_and_set_bit(0, (unsigned long *) - &anon_vma->root->rb_root.rb_root.rb_node)) - BUG(); + BUG_ON(__test_and_set_bit(0, (unsigned long *) + &anon_vma->root->rb_root.rb_root.rb_node)); } } @@ -3587,8 +3585,7 @@ static void vm_lock_mapping(struct mm_st * mm_all_locks_mutex, there may be other cpus * changing other bitflags in parallel to us. */ - if (test_and_set_bit(AS_MM_ALL_LOCKS, &mapping->flags)) - BUG(); + BUG_ON(test_and_set_bit(AS_MM_ALL_LOCKS, &mapping->flags)); down_write_nest_lock(&mapping->i_mmap_rwsem, &mm->mmap_lock); } } @@ -3685,9 +3682,8 @@ static void vm_unlock_anon_vma(struct an * can't change from under us until we release the * anon_vma->root->rwsem. */ - if (!__test_and_clear_bit(0, (unsigned long *) - &anon_vma->root->rb_root.rb_root.rb_node)) - BUG(); + BUG_ON(!__test_and_clear_bit(0, (unsigned long *) + &anon_vma->root->rb_root.rb_root.rb_node)); anon_vma_unlock_write(anon_vma); } } @@ -3700,9 +3696,7 @@ static void vm_unlock_mapping(struct add * because we hold the mm_all_locks_mutex. */ i_mmap_unlock_write(mapping); - if (!test_and_clear_bit(AS_MM_ALL_LOCKS, - &mapping->flags)) - BUG(); + BUG_ON(!test_and_clear_bit(AS_MM_ALL_LOCKS, &mapping->flags)); } } _ Patches currently in -mm which might be from alex.shi@xxxxxxxxxxxxxxxxx are mm-memcg-revise-the-using-condition-of-lock_page_lruvec-function-series.patch mm-memcg-remove-rcu-locking-for-lock_page_lruvec-function-series.patch mm-vmscan-__isolate_lru_page_prepare-clean-up.patch mm-compaction-remove-rcu_read_lock-during-page-compaction.patch