Skip to contentSkip to conversation

Use BUILD_BUG_ON for VM_STACK_FLAGS & VM_STACK_INCOMPLETE_SETUP

PATCH New Michal Hocko 1 participant 1 message May 27, 2011

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

PATCH 1/1 Use BUILD_BUG_ON for VM_STACK_FLAGS & VM_STACK_INCOMPLETE_SETUP

a8bef8ff has introduced BUG_ON to force that VM_STACK_FLAGS and VM_STACK_INCOMPLETE_SETUP do not overlap.
The check is compile time so BUILD_BUG_ON is more appropriate.

---
 fs/exec.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/exec.c +1 -1
index 5e62d26..cc10876 100644
@@ -272,7 +272,7 @@ static int __bprm_mm_init(struct linux_binprm *bprm)
 	 * use STACK_TOP because that can depend on attributes which aren't
 	 * configured yet.
 	 */
-	BUG_ON(VM_STACK_FLAGS & VM_STACK_INCOMPLETE_SETUP);
+	BUILD_BUG_ON(VM_STACK_FLAGS & VM_STACK_INCOMPLETE_SETUP);
 	vma->vm_end = STACK_TOP_MAX;
 	vma->vm_start = vma->vm_end - PAGE_SIZE;
 	vma->vm_flags = VM_STACK_FLAGS | VM_STACK_INCOMPLETE_SETUP;
Signature · 9 lines
1.7.4.4

-- 
Michal Hocko
SUSE Labs
SUSE LINUX s.r.o.
Lihovarska 1060/12
190 00 Praha 9    
Czech Republic