diff options
author | Robin Holt <holt@sgi.com> | 2009-01-29 17:25:07 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-29 21:04:43 -0500 |
commit | 252523ef2421b803de4810876223e4d695f23ec6 (patch) | |
tree | 7b1037a592edc5c428b5739f6231b1fec9267070 /drivers/misc | |
parent | 17e2161654da4e6bdfd8d53d4f52e820ee93f423 (diff) |
sgi-xpc: fix up stale DBUG_ON statements
Clean up the stale DBUG_ON checks and add a couple new ones.
Signed-off-by: Robin Holt <holt@sgi.com>
Signed-off-by: Dean Nelson <dcn@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/sgi-xp/xpc_channel.c | 3 | ||||
-rw-r--r-- | drivers/misc/sgi-xp/xpc_sn2.c | 15 |
2 files changed, 11 insertions, 7 deletions
diff --git a/drivers/misc/sgi-xp/xpc_channel.c b/drivers/misc/sgi-xp/xpc_channel.c index 9cd2ebe2a3b6..45fd653dbe31 100644 --- a/drivers/misc/sgi-xp/xpc_channel.c +++ b/drivers/misc/sgi-xp/xpc_channel.c | |||
@@ -49,9 +49,6 @@ xpc_process_connect(struct xpc_channel *ch, unsigned long *irq_flags) | |||
49 | 49 | ||
50 | if (ch->flags & (XPC_C_CONNECTED | XPC_C_DISCONNECTING)) | 50 | if (ch->flags & (XPC_C_CONNECTED | XPC_C_DISCONNECTING)) |
51 | return; | 51 | return; |
52 | |||
53 | DBUG_ON(ch->local_msgqueue == NULL); | ||
54 | DBUG_ON(ch->remote_msgqueue == NULL); | ||
55 | } | 52 | } |
56 | 53 | ||
57 | if (!(ch->flags & XPC_C_OPENREPLY)) { | 54 | if (!(ch->flags & XPC_C_OPENREPLY)) { |
diff --git a/drivers/misc/sgi-xp/xpc_sn2.c b/drivers/misc/sgi-xp/xpc_sn2.c index 7d05fb5f4fee..2e975762c32b 100644 --- a/drivers/misc/sgi-xp/xpc_sn2.c +++ b/drivers/misc/sgi-xp/xpc_sn2.c | |||
@@ -1106,8 +1106,6 @@ xpc_process_activate_IRQ_rcvd_sn2(void) | |||
1106 | int n_IRQs_expected; | 1106 | int n_IRQs_expected; |
1107 | int n_IRQs_detected; | 1107 | int n_IRQs_detected; |
1108 | 1108 | ||
1109 | DBUG_ON(xpc_activate_IRQ_rcvd == 0); | ||
1110 | |||
1111 | spin_lock_irqsave(&xpc_activate_IRQ_rcvd_lock, irq_flags); | 1109 | spin_lock_irqsave(&xpc_activate_IRQ_rcvd_lock, irq_flags); |
1112 | n_IRQs_expected = xpc_activate_IRQ_rcvd; | 1110 | n_IRQs_expected = xpc_activate_IRQ_rcvd; |
1113 | xpc_activate_IRQ_rcvd = 0; | 1111 | xpc_activate_IRQ_rcvd = 0; |
@@ -1726,6 +1724,7 @@ xpc_clear_local_msgqueue_flags_sn2(struct xpc_channel *ch) | |||
1726 | msg = (struct xpc_msg_sn2 *)((u64)ch_sn2->local_msgqueue + | 1724 | msg = (struct xpc_msg_sn2 *)((u64)ch_sn2->local_msgqueue + |
1727 | (get % ch->local_nentries) * | 1725 | (get % ch->local_nentries) * |
1728 | ch->entry_size); | 1726 | ch->entry_size); |
1727 | DBUG_ON(!(msg->flags & XPC_M_SN2_READY)); | ||
1729 | msg->flags = 0; | 1728 | msg->flags = 0; |
1730 | } while (++get < ch_sn2->remote_GP.get); | 1729 | } while (++get < ch_sn2->remote_GP.get); |
1731 | } | 1730 | } |
@@ -1740,11 +1739,18 @@ xpc_clear_remote_msgqueue_flags_sn2(struct xpc_channel *ch) | |||
1740 | struct xpc_msg_sn2 *msg; | 1739 | struct xpc_msg_sn2 *msg; |
1741 | s64 put; | 1740 | s64 put; |
1742 | 1741 | ||
1743 | put = ch_sn2->w_remote_GP.put; | 1742 | /* flags are zeroed when the buffer is allocated */ |
1743 | if (ch_sn2->remote_GP.put < ch->remote_nentries) | ||
1744 | return; | ||
1745 | |||
1746 | put = max(ch_sn2->w_remote_GP.put, ch->remote_nentries); | ||
1744 | do { | 1747 | do { |
1745 | msg = (struct xpc_msg_sn2 *)((u64)ch_sn2->remote_msgqueue + | 1748 | msg = (struct xpc_msg_sn2 *)((u64)ch_sn2->remote_msgqueue + |
1746 | (put % ch->remote_nentries) * | 1749 | (put % ch->remote_nentries) * |
1747 | ch->entry_size); | 1750 | ch->entry_size); |
1751 | DBUG_ON(!(msg->flags & XPC_M_SN2_READY)); | ||
1752 | DBUG_ON(!(msg->flags & XPC_M_SN2_DONE)); | ||
1753 | DBUG_ON(msg->number != put - ch->remote_nentries); | ||
1748 | msg->flags = 0; | 1754 | msg->flags = 0; |
1749 | } while (++put < ch_sn2->remote_GP.put); | 1755 | } while (++put < ch_sn2->remote_GP.put); |
1750 | } | 1756 | } |
@@ -2280,8 +2286,9 @@ xpc_received_payload_sn2(struct xpc_channel *ch, void *payload) | |||
2280 | dev_dbg(xpc_chan, "msg=0x%p, msg_number=%ld, partid=%d, channel=%d\n", | 2286 | dev_dbg(xpc_chan, "msg=0x%p, msg_number=%ld, partid=%d, channel=%d\n", |
2281 | (void *)msg, msg_number, ch->partid, ch->number); | 2287 | (void *)msg, msg_number, ch->partid, ch->number); |
2282 | 2288 | ||
2283 | DBUG_ON((((u64)msg - (u64)ch->remote_msgqueue) / ch->entry_size) != | 2289 | DBUG_ON((((u64)msg - (u64)ch->sn.sn2.remote_msgqueue) / ch->entry_size) != |
2284 | msg_number % ch->remote_nentries); | 2290 | msg_number % ch->remote_nentries); |
2291 | DBUG_ON(!(msg->flags & XPC_M_SN2_READY)); | ||
2285 | DBUG_ON(msg->flags & XPC_M_SN2_DONE); | 2292 | DBUG_ON(msg->flags & XPC_M_SN2_DONE); |
2286 | 2293 | ||
2287 | msg->flags |= XPC_M_SN2_DONE; | 2294 | msg->flags |= XPC_M_SN2_DONE; |