Skip to contentSkip to conversation

BUG_ON() Conversion in mm/memory.c

PATCH In review Eric Sesterhenn / snakebyte 1 participant 1 message Jan 31, 2006

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 2/7 BUG_ON() Conversion in mm/memory.c

hi,

this changes if() BUG(); constructs to BUG_ON() which is cleaner, contains unlikely() and can better optimized away.

mm/memory.c renamed from mm/memory.c.orig +2 -4
@@ -2339,10 +2339,8 @@ int make_pages_present(unsigned long add
 	if (!vma)
 		return -1;
 	write = (vma->vm_flags & VM_WRITE) != 0;
-	if (addr >= end)
-		BUG();
-	if (end > vma->vm_end)
-		BUG();
+	BUG_ON(addr >= end);
+	BUG_ON(end > vma->vm_end);
 	len = (end+PAGE_SIZE-1)/PAGE_SIZE-addr/PAGE_SIZE;
 	ret = get_user_pages(current, current->mm, addr,
 			len, write, 0, NULL, NULL);

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors