Skip to content

Commit

Permalink
BUG_ON() Conversion in ipc/util.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 <[email protected]>
Signed-off-by: Adrian Bunk <[email protected]>
  • Loading branch information
SesterhennEric authored and AdrianBunk committed Mar 31, 2006
1 parent 99cee0c commit 9bc98fc
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions ipc/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,17 +266,15 @@ struct kern_ipc_perm* ipc_rmid(struct ipc_ids* ids, int id)
{
struct kern_ipc_perm* p;
int lid = id % SEQ_MULTIPLIER;
if(lid >= ids->entries->size)
BUG();
BUG_ON(lid >= ids->entries->size);

/*
* do not need a rcu_dereference()() here to force ordering
* on Alpha, since the ipc_ids.mutex is held.
*/
p = ids->entries->p[lid];
ids->entries->p[lid] = NULL;
if(p==NULL)
BUG();
BUG_ON(p==NULL);
ids->in_use--;

if (lid == ids->max_id) {
Expand Down

0 comments on commit 9bc98fc

Please sign in to comment.