Skip to content

Commit

Permalink
BUG_ON() Conversion in ipc/sem.c
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Sesterhenn authored and Adrian Bunk committed Mar 26, 2006
1 parent 309be53 commit 27315c9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions ipc/sem.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,7 @@ asmlinkage long sys_semget (key_t key, int nsems, int semflg)
err = -EEXIST;
} else {
sma = sem_lock(id);
if(sma==NULL)
BUG();
BUG_ON(sma==NULL);
if (nsems > sma->sem_nsems)
err = -EINVAL;
else if (ipcperms(&sma->sem_perm, semflg))
Expand Down Expand Up @@ -1181,8 +1180,7 @@ asmlinkage long sys_semtimedop(int semid, struct sembuf __user *tsops,

sma = sem_lock(semid);
if(sma==NULL) {
if(queue.prev != NULL)
BUG();
BUG_ON(queue.prev != NULL);
error = -EIDRM;
goto out_free;
}
Expand Down

0 comments on commit 27315c9

Please sign in to comment.