mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
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: Eric Sesterhenn <snakebyte@gmx.de> Signed-off-by: Adrian Bunk <bunk@stusta.de>
This commit is contained in:
parent
309be53da6
commit
27315c96a4
1 changed files with 2 additions and 4 deletions
|
@ -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 @@ retry_undos:
|
||||||
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue