Commit 27315c96 authored by Eric Sesterhenn's avatar Eric Sesterhenn Committed by Adrian Bunk

BUG_ON() Conversion in ipc/sem.c

this changes if() BUG(); constructs to BUG_ON() which is
cleaner, contains unlikely() and can better optimized away.
Signed-off-by: default avatarEric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
parent 309be53d
...@@ -227,8 +227,7 @@ asmlinkage long sys_semget (key_t key, int nsems, int semflg) ...@@ -227,8 +227,7 @@ asmlinkage long sys_semget (key_t key, int nsems, int semflg)
err = -EEXIST; err = -EEXIST;
} else { } else {
sma = sem_lock(id); sma = sem_lock(id);
if(sma==NULL) BUG_ON(sma==NULL);
BUG();
if (nsems > sma->sem_nsems) if (nsems > sma->sem_nsems)
err = -EINVAL; err = -EINVAL;
else if (ipcperms(&sma->sem_perm, semflg)) else if (ipcperms(&sma->sem_perm, semflg))
...@@ -1181,8 +1180,7 @@ asmlinkage long sys_semtimedop(int semid, struct sembuf __user *tsops, ...@@ -1181,8 +1180,7 @@ asmlinkage long sys_semtimedop(int semid, struct sembuf __user *tsops,
sma = sem_lock(semid); sma = sem_lock(semid);
if(sma==NULL) { if(sma==NULL) {
if(queue.prev != NULL) BUG_ON(queue.prev != NULL);
BUG();
error = -EIDRM; error = -EIDRM;
goto out_free; goto out_free;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment