From: Borislav Petkov <petkovbb@googlemail.com>
To: bzolnier@gmail.com
Cc: linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org,
Borislav Petkov <petkovbb@gmail.com>
Subject: [PATCH 02/18] ide-cd: remove ide_cd_drain_data and ide_cd_pad_transfer
Date: Thu, 12 Jun 2008 08:40:54 +0200 [thread overview]
Message-ID: <1213252870-20474-3-git-send-email-petkovbb@gmail.com> (raw)
In-Reply-To: <1213252870-20474-1-git-send-email-petkovbb@gmail.com>
Use the generic ide_pad_transfer() helper instead
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
---
drivers/ide/ide-cd.c | 33 ++++-----------------------------
1 files changed, 4 insertions(+), 29 deletions(-)
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 92a8a36..2f0c9d4 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -599,28 +599,6 @@ static ide_startstop_t cdrom_transfer_packet_command(ide_drive_t *drive,
}
/*
- * Block read functions.
- */
-static void ide_cd_pad_transfer(ide_drive_t *drive, xfer_func_t *xf, int len)
-{
- while (len > 0) {
- int dum = 0;
- xf(drive, NULL, &dum, sizeof(dum));
- len -= sizeof(dum);
- }
-}
-
-static void ide_cd_drain_data(ide_drive_t *drive, int nsects)
-{
- while (nsects > 0) {
- static char dum[SECTOR_SIZE];
-
- drive->hwif->input_data(drive, NULL, dum, sizeof(dum));
- nsects--;
- }
-}
-
-/*
* Check the contents of the interrupt reason register from the cdrom
* and attempt to recover if there are problems. Returns 0 if everything's
* ok; nonzero if the request has been terminated.
@@ -635,15 +613,12 @@ static int ide_cd_check_ireason(ide_drive_t *drive, struct request *rq,
if (ireason == (!rw << 1))
return 0;
else if (ireason == (rw << 1)) {
- ide_hwif_t *hwif = drive->hwif;
- xfer_func_t *xf;
/* whoops... */
printk(KERN_ERR "%s: %s: wrong transfer direction!\n",
drive->name, __func__);
- xf = rw ? hwif->output_data : hwif->input_data;
- ide_cd_pad_transfer(drive, xf, len);
+ ide_pad_transfer(drive, rw, len);
} else if (rw == 0 && ireason == 1) {
/*
* Some drives (ASUS) seem to tell us that status info is
@@ -1006,7 +981,7 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
- bio_cur_sectors(rq->bio),
thislen >> 9);
if (nskip > 0) {
- ide_cd_drain_data(drive, nskip);
+ ide_pad_transfer(drive, write, nskip);
rq->current_nr_sectors -= nskip;
thislen -= (nskip << 9);
}
@@ -1043,7 +1018,7 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
* If the buffers are full, pipe the rest into
* oblivion.
*/
- ide_cd_drain_data(drive, thislen >> 9);
+ ide_pad_transfer(drive, 0, thislen >> 9);
else {
printk(KERN_ERR "%s: confused, missing data\n",
drive->name);
@@ -1091,7 +1066,7 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
/* pad, if necessary */
if (!blk_fs_request(rq) && len > 0)
- ide_cd_pad_transfer(drive, xferfunc, len);
+ ide_pad_transfer(drive, write, len);
if (blk_pc_request(rq)) {
timeout = rq->timeout;
--
1.5.5.1
next prev parent reply other threads:[~2008-06-12 6:41 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-12 6:40 [PATCH 00/18] misc generic ide stuff Borislav Petkov
2008-06-12 6:40 ` [PATCH 01/18] ide-cd: remove wait-for-idle-controller bit in cdrom_start_packet_command Borislav Petkov
2008-06-12 6:40 ` Borislav Petkov [this message]
2008-06-14 17:29 ` [PATCH 02/18] ide-cd: remove ide_cd_drain_data and ide_cd_pad_transfer Bartlomiej Zolnierkiewicz
2008-06-15 9:28 ` Borislav Petkov
2008-06-12 6:40 ` [PATCH 03/18] ide-cd: cdrom_decode_status: factor out block pc error handling code Borislav Petkov
2008-06-14 17:29 ` Bartlomiej Zolnierkiewicz
2008-08-15 7:34 ` Borislav Petkov
2008-08-16 20:26 ` Borislav Petkov
2008-08-15 7:34 ` Borislav Petkov
2008-06-12 6:40 ` [PATCH 04/18] ide-cd: cdrom_decode_status: factor out fs request " Borislav Petkov
2008-06-12 6:40 ` [PATCH 05/18] ide-cd: ide_do_rw_cdrom: add the catch-all bad request case to the if-else block Borislav Petkov
2008-06-12 6:40 ` [PATCH 06/18] ide-cd: cdrom_start_seek: remove unused argument block Borislav Petkov
2008-06-12 6:40 ` [PATCH 07/18] ide-cd: mv ide_do_rw_cdrom ide_cd_do_request Borislav Petkov
2008-06-12 6:41 ` [PATCH 08/18] ide-cd: simplify request issuing path Borislav Petkov
2008-06-12 6:41 ` [PATCH 09/18] ide-cd: fold cdrom_start_seek into ide_cd_do_request Borislav Petkov
2008-06-12 6:41 ` [PATCH 10/18] ide-cd: move request prep from cdrom_start_seek_continuation to rq issue path Borislav Petkov
2008-06-12 6:41 ` [PATCH 11/18] ide-cd: move request prep from cdrom_start_rw_cont " Borislav Petkov
2008-06-12 6:41 ` [PATCH 12/18] ide-cd: move request prep chunk from cdrom_do_newpc_cont " Borislav Petkov
2008-06-12 6:41 ` [PATCH 13/18] ide-floppy: replace pc->c with rq->cmd Borislav Petkov
2008-06-14 17:40 ` Bartlomiej Zolnierkiewicz
2008-06-15 10:21 ` Borislav Petkov
2008-06-15 14:57 ` Bartlomiej Zolnierkiewicz
2008-06-12 6:41 ` [PATCH 14/18] ide-floppy: fold idefloppy_create_test_unit_ready_cmd into idefloppy_open Borislav Petkov
2008-06-12 6:41 ` [PATCH 15/18] ide-floppy: zero out the whole struct ide_atapi_pc on init Borislav Petkov
2008-06-12 6:41 ` [PATCH 16/18] ide-floppy: pass rq instead of pc to idefloppy_issue_pc Borislav Petkov
2008-06-12 6:41 ` [PATCH 17/18] ide-floppy: cleanup idefloppy_create_rw_cmd Borislav Petkov
2008-06-12 6:41 ` [PATCH 18/18] ide: use flags in IRQ handler Borislav Petkov
2008-06-14 17:47 ` Bartlomiej Zolnierkiewicz
2008-06-14 17:29 ` [PATCH 00/18] misc generic ide stuff Bartlomiej Zolnierkiewicz
2008-06-15 10:27 ` Borislav Petkov
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=1213252870-20474-3-git-send-email-petkovbb@gmail.com \
--to=petkovbb@googlemail.com \
--cc=bzolnier@gmail.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=petkovbb@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).