BUG_ON() Conversion in mm/vmalloc.c
Subsystems (3)
PATCH 7/7 BUG_ON() Conversion in mm/vmalloc.c
hi,
this changes if() BUG(); constructs to BUG_ON() which is cleaner, contains unlikely() and can better optimized away.
mm/vmalloc.c renamed from mm/vmalloc.c.orig +1 -2
@@ -321,8 +321,7 @@ void __vunmap(void *addr, int deallocateint i;for (i =0 ; i < area->nr_pages; i++) { -if (unlikely (!area->pages[i])) -BUG (); +BUG_ON (unlikely (!area->pages[i]));__free_page (area->pages[i]); }
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors
Quoted 10 lines · Eric Sesterhenn / snakebyte
hi,
this changes
if()BUG(); constructs toBUG_ON()which is cleaner, containsunlikely()and can better optimized away.Signed-off-by Eric Sesterhenn <[email protected]>
mm/vmalloc.c void __vunmap(void *addr, int deallocate · line 324
Quoted 7 lines
mm/vmalloc.c renamed from mm/vmalloc.c.orig +1
-2@@ -321,8 +321,7 @@ void __vunmap(void *addr, int deallocateint i;for (i =0 ; i < area->nr_pages; i++) { -if (unlikely (!area->pages[i])) -BUG (); +BUG_ON (unlikely (!area->pages[i]));
You can drop the unlikely.
cu
Adrian
Signature · 4 lines
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors
hi,
Quoted 6 lines
Review
Quoted 4 lines
(quoted diff) +1
-2- if (unlikely(!area->pages[i])) - BUG(); + BUG_ON(unlikely(!area->pages[i]));You can drop the unlikely.
of course... thanks.
Here is an updated patch
mm/vmalloc.c renamed from mm/vmalloc.c.orig +1 -2
@@ -321,8 +321,7 @@ void __vunmap(void *addr, int deallocateint i;for (i =0 ; i < area->nr_pages; i++) { -if (unlikely (!area->pages[i])) -BUG (); +BUG_ON (!area->pages[i]);__free_page (area->pages[i]); }
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors