[PATCH 6/9] ide: remove BUG() from ide_complete_rq()

From: Bartlomiej Zolnierkiewicz
Date: Mon Feb 09 2009 - 15:02:05 EST


From: Bartlomiej Zolnierkiewicz <bzolnier@xxxxxxxxx>
Subject: [PATCH] ide: remove BUG() from ide_complete_rq()

It is no longer needed so remove it, also while at it dequeue the request
only on blk_end_request() success and make ide_complete_rq() return an error
value.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@xxxxxxxxx>
---
drivers/ide/ide-io.c | 10 ++++++----
include/linux/ide.h | 2 +-
2 files changed, 7 insertions(+), 5 deletions(-)

Index: b/drivers/ide/ide-io.c
===================================================================
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -137,15 +137,17 @@ void ide_complete_cmd(ide_drive_t *drive
kfree(cmd);
}

-void ide_complete_rq(ide_drive_t *drive, int error)
+int ide_complete_rq(ide_drive_t *drive, int error)
{
ide_hwif_t *hwif = drive->hwif;
struct request *rq = hwif->rq;
+ int rc;

- hwif->rq = NULL;
+ rc = blk_end_request(rq, error, blk_rq_bytes(rq));
+ if (rc == 0)
+ hwif->rq = NULL;

- if (unlikely(blk_end_request(rq, error, blk_rq_bytes(rq))))
- BUG();
+ return rc;
}
EXPORT_SYMBOL(ide_complete_rq);

Index: b/include/linux/ide.h
===================================================================
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1163,7 +1163,7 @@ extern int ide_devset_execute(ide_drive_
const struct ide_devset *setting, int arg);

void ide_complete_cmd(ide_drive_t *, struct ide_cmd *, u8, u8);
-void ide_complete_rq(ide_drive_t *, int);
+int ide_complete_rq(ide_drive_t *, int);

void ide_tf_dump(const char *, struct ide_taskfile *);

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/