ide: remove BUG() from ide_complete_rq()
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Fri, 27 Mar 2009 11:46:44 +0000 (12:46 +0100)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Fri, 27 Mar 2009 11:46:44 +0000 (12:46 +0100)
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@gmail.com>
drivers/ide/ide-io.c
include/linux/ide.h

index 28ac463dde1c8bb0ccf47baade9b17ca4be003db..4a79d28600f50a29a183b4da349b4f5f945754b8 100644 (file)
@@ -141,15 +141,17 @@ void ide_complete_cmd(ide_drive_t *drive, struct ide_cmd *cmd, u8 stat, u8 err)
                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 32369d5797de7eacae1f0e295a89c59558700908..bb62bfaf02e0d520485d51ce7c47492ba0f734b0 100644 (file)
@@ -1166,7 +1166,7 @@ extern int ide_devset_execute(ide_drive_t *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 *);