Skip to content

Commit 61e1655

Browse files
wangxiaoqtorvalds
authored andcommitted
mm/vmalloc.c: use macro IS_ALIGNED to judge the aligment
Just cleanup, no functional change. Signed-off-by: Wang Xiaoqiang <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 654a0dd commit 61e1655

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mm/vmalloc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ static struct vmap_area *alloc_vmap_area(unsigned long size,
455455
free_vmap_cache = &va->rb_node;
456456
spin_unlock(&vmap_area_lock);
457457

458-
BUG_ON(va->va_start & (align-1));
458+
BUG_ON(!IS_ALIGNED(va->va_start, align));
459459
BUG_ON(va->va_start < vstart);
460460
BUG_ON(va->va_end > vend);
461461

@@ -1086,7 +1086,7 @@ void vm_unmap_ram(const void *mem, unsigned int count)
10861086
BUG_ON(!addr);
10871087
BUG_ON(addr < VMALLOC_START);
10881088
BUG_ON(addr > VMALLOC_END);
1089-
BUG_ON(addr & (PAGE_SIZE-1));
1089+
BUG_ON(!IS_ALIGNED(addr, PAGE_SIZE));
10901090

10911091
debug_check_no_locks_freed(mem, size);
10921092
vmap_debug_free_range(addr, addr+size);

0 commit comments

Comments
 (0)