From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: linux-ide@vger.kernel.org
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH 6/9] ide: remove BUG() from ide_complete_rq()
Date: Mon, 09 Feb 2009 21:01:28 +0100 [thread overview]
Message-ID: <20090209200128.7985.59685.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20090209200042.7985.94247.sendpatchset@localhost.localdomain>
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
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@gmail.com>
---
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 *);
next prev parent reply other threads:[~2009-02-09 20:00 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-09 20:00 [PATCH 0/9] ide: unify request completion methods Bartlomiej Zolnierkiewicz
2009-02-09 20:00 ` [PATCH 1/9] ide: make ide_special_rq() BUG() on unknown requests Bartlomiej Zolnierkiewicz
2009-02-09 20:00 ` [PATCH 2/9] ide: add ide_end_rq() Bartlomiej Zolnierkiewicz
2009-02-09 20:01 ` [PATCH 3/9] ide: sanitize ide_end_rq() Bartlomiej Zolnierkiewicz
2009-02-09 20:01 ` [PATCH 4/9] ide: pass error value to ide_complete_rq() Bartlomiej Zolnierkiewicz
2009-02-09 20:01 ` [PATCH 5/9] ide: move rq->errors quirk out from ide_end_request() Bartlomiej Zolnierkiewicz
2009-02-09 20:01 ` Bartlomiej Zolnierkiewicz [this message]
2009-02-09 20:01 ` [PATCH 7/9] ide: pass number of bytes to complete to ide_complete_rq() Bartlomiej Zolnierkiewicz
2009-02-09 20:01 ` [PATCH 8/9] ide: use ide_end_rq() in ide_complete_rq() Bartlomiej Zolnierkiewicz
2009-02-09 20:01 ` [PATCH 9/9] ide: remove ide_end_request() Bartlomiej Zolnierkiewicz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090209200128.7985.59685.sendpatchset@localhost.localdomain \
--to=bzolnier@gmail.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.