From: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
To: linux-ide@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] IDE cleanups for 2.6.4-rc1 (1/3)
Date: Tue, 2 Mar 2004 22:13:50 +0100 [thread overview]
Message-ID: <200403022213.50294.bzolnier@elka.pw.edu.pl> (raw)
[IDE] ide-disk.c: cleanup get_command()
linux-2.6.4-rc1-root/drivers/ide/ide-disk.c | 39 +++++++++++++---------------
1 files changed, 19 insertions(+), 20 deletions(-)
diff -puN drivers/ide/ide-disk.c~ide_get_command drivers/ide/ide-disk.c
--- linux-2.6.4-rc1/drivers/ide/ide-disk.c~ide_get_command 2004-03-02 22:11:00.063116680 +0100
+++ linux-2.6.4-rc1-root/drivers/ide/ide-disk.c 2004-03-02 22:11:00.073115160 +0100
@@ -569,28 +569,27 @@ ide_startstop_t __ide_do_rw_disk (ide_dr
}
EXPORT_SYMBOL_GPL(__ide_do_rw_disk);
-static task_ioreg_t get_command (ide_drive_t *drive, int cmd)
+static u8 get_command(ide_drive_t *drive, int cmd)
{
- int lba48bit = (drive->addressing == 1) ? 1 : 0;
+ unsigned int lba48 = (drive->addressing == 1) ? 1 : 0;
- if ((cmd == READ) && drive->using_tcq)
- return lba48bit ? WIN_READDMA_QUEUED_EXT : WIN_READDMA_QUEUED;
- if ((cmd == READ) && (drive->using_dma))
- return (lba48bit) ? WIN_READDMA_EXT : WIN_READDMA;
- else if ((cmd == READ) && (drive->mult_count))
- return (lba48bit) ? WIN_MULTREAD_EXT : WIN_MULTREAD;
- else if (cmd == READ)
- return (lba48bit) ? WIN_READ_EXT : WIN_READ;
- else if ((cmd == WRITE) && drive->using_tcq)
- return lba48bit ? WIN_WRITEDMA_QUEUED_EXT : WIN_WRITEDMA_QUEUED;
- else if ((cmd == WRITE) && (drive->using_dma))
- return (lba48bit) ? WIN_WRITEDMA_EXT : WIN_WRITEDMA;
- else if ((cmd == WRITE) && (drive->mult_count))
- return (lba48bit) ? WIN_MULTWRITE_EXT : WIN_MULTWRITE;
- else if (cmd == WRITE)
- return (lba48bit) ? WIN_WRITE_EXT : WIN_WRITE;
- else
- return WIN_NOP;
+ if (cmd == READ) {
+ if (drive->using_tcq)
+ return lba48 ? WIN_READDMA_QUEUED_EXT : WIN_READDMA_QUEUED;
+ if (drive->using_dma)
+ return lba48 ? WIN_READDMA_EXT : WIN_READDMA;
+ if (drive->mult_count)
+ return lba48 ? WIN_MULTREAD_EXT : WIN_MULTREAD;
+ return lba48 ? WIN_READ_EXT : WIN_READ;
+ } else {
+ if (drive->using_tcq)
+ return lba48 ? WIN_WRITEDMA_QUEUED_EXT : WIN_WRITEDMA_QUEUED;
+ if (drive->using_dma)
+ return lba48 ? WIN_WRITEDMA_EXT : WIN_WRITEDMA;
+ if (drive->mult_count)
+ return lba48 ? WIN_MULTWRITE_EXT : WIN_MULTWRITE;
+ return lba48 ? WIN_WRITE_EXT : WIN_WRITE;
+ }
}
static ide_startstop_t chs_rw_disk (ide_drive_t *drive, struct request *rq, unsigned long block)
_
reply other threads:[~2004-03-02 21:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=200403022213.50294.bzolnier@elka.pw.edu.pl \
--to=b.zolnierkiewicz@elka.pw.edu.pl \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®