BUG_ON() Conversion in drivers/s390/net/lcs.c
authorEric Sesterhenn <snakebyte@gmx.de>
Sun, 2 Apr 2006 11:50:14 +0000 (13:50 +0200)
committerAdrian Bunk <bunk@stusta.de>
Sun, 2 Apr 2006 11:50:14 +0000 (13:50 +0200)
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>
drivers/s390/net/lcs.c

index edcf05d5d568af56dcbcb6e85eec70bcaefacb54..5d6b7a57b02f16e81bb1a343480e64e3ff464d5d 100644 (file)
@@ -675,9 +675,8 @@ lcs_ready_buffer(struct lcs_channel *channel, struct lcs_buffer *buffer)
        int index, rc;
 
        LCS_DBF_TEXT(5, trace, "rdybuff");
-       if (buffer->state != BUF_STATE_LOCKED &&
-           buffer->state != BUF_STATE_PROCESSED)
-               BUG();
+       BUG_ON(buffer->state != BUF_STATE_LOCKED &&
+               buffer->state != BUF_STATE_PROCESSED);
        spin_lock_irqsave(get_ccwdev_lock(channel->ccwdev), flags);
        buffer->state = BUF_STATE_READY;
        index = buffer - channel->iob;
@@ -701,8 +700,7 @@ __lcs_processed_buffer(struct lcs_channel *channel, struct lcs_buffer *buffer)
        int index, prev, next;
 
        LCS_DBF_TEXT(5, trace, "prcsbuff");
-       if (buffer->state != BUF_STATE_READY)
-               BUG();
+       BUG_ON(buffer->state != BUF_STATE_READY);
        buffer->state = BUF_STATE_PROCESSED;
        index = buffer - channel->iob;
        prev = (index - 1) & (LCS_NUM_BUFFS - 1);
@@ -734,9 +732,8 @@ lcs_release_buffer(struct lcs_channel *channel, struct lcs_buffer *buffer)
        unsigned long flags;
 
        LCS_DBF_TEXT(5, trace, "relbuff");
-       if (buffer->state != BUF_STATE_LOCKED &&
-           buffer->state != BUF_STATE_PROCESSED)
-               BUG();
+       BUG_ON(buffer->state != BUF_STATE_LOCKED &&
+               buffer->state != BUF_STATE_PROCESSED);
        spin_lock_irqsave(get_ccwdev_lock(channel->ccwdev), flags);
        buffer->state = BUF_STATE_EMPTY;
        spin_unlock_irqrestore(get_ccwdev_lock(channel->ccwdev), flags);