aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2009-04-22 22:05:19 -0400
committerJens Axboe <jens.axboe@oracle.com>2009-04-28 01:37:35 -0400
commit40cbbb781d3eba5d6ac0860db078af490e5c7c6b (patch)
treedec374543cf045fc630bccddbb7646c695094b0d /arch
parentb243ddcbe9be146172baa544dadecebf156eda0e (diff)
block: implement and use [__]blk_end_request_all()
There are many [__]blk_end_request() call sites which call it with full request length and expect full completion. Many of them ensure that the request actually completes by doing BUG_ON() the return value, which is awkward and error-prone. This patch adds [__]blk_end_request_all() which takes @rq and @error and fully completes the request. BUG_ON() is added to to ensure that this actually happens. Most conversions are simple but there are a few noteworthy ones. * cdrom/viocd: viocd_end_request() replaced with direct calls to __blk_end_request_all(). * s390/block/dasd: dasd_end_request() replaced with direct calls to __blk_end_request_all(). * s390/char/tape_block: tapeblock_end_request() replaced with direct calls to blk_end_request_all(). [ Impact: cleanup ] Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Russell King <rmk@arm.linux.org.uk> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Mike Miller <mike.miller@hp.com> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Jeff Garzik <jgarzik@pobox.com> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Jeremy Fitzhardinge <jeremy@xensource.com> Cc: Alex Dubov <oakad@yahoo.com> Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/plat-omap/mailbox.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c
index 0abfbaa59871..cf81bad8aec2 100644
--- a/arch/arm/plat-omap/mailbox.c
+++ b/arch/arm/plat-omap/mailbox.c
@@ -192,8 +192,7 @@ static void mbox_tx_work(struct work_struct *work)
192 } 192 }
193 193
194 spin_lock(q->queue_lock); 194 spin_lock(q->queue_lock);
195 if (__blk_end_request(rq, 0, 0)) 195 __blk_end_request_all(rq, 0);
196 BUG();
197 spin_unlock(q->queue_lock); 196 spin_unlock(q->queue_lock);
198 } 197 }
199} 198}
@@ -224,10 +223,7 @@ static void mbox_rx_work(struct work_struct *work)
224 break; 223 break;
225 224
226 msg = (mbox_msg_t) rq->data; 225 msg = (mbox_msg_t) rq->data;
227 226 blk_end_request_all(rq, 0);
228 if (blk_end_request(rq, 0, 0))
229 BUG();
230
231 mbox->rxq->callback((void *)msg); 227 mbox->rxq->callback((void *)msg);
232 } 228 }
233} 229}
@@ -337,8 +333,7 @@ omap_mbox_read(struct device *dev, struct device_attribute *attr, char *buf)
337 333
338 *p = (mbox_msg_t) rq->data; 334 *p = (mbox_msg_t) rq->data;
339 335
340 if (blk_end_request(rq, 0, 0)) 336 blk_end_request_all(rq, 0);
341 BUG();
342 337
343 if (unlikely(mbox_seq_test(mbox, *p))) { 338 if (unlikely(mbox_seq_test(mbox, *p))) {
344 pr_info("mbox: Illegal seq bit!(%08x) ignored\n", *p); 339 pr_info("mbox: Illegal seq bit!(%08x) ignored\n", *p);