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 06/10] ide-atapi: add a DEV_IS_IDECD macro
Date: Sun, 14 Sep 2008 13:35:54 +0200 [thread overview]
Message-ID: <1221392158-3848-7-git-send-email-petkovbb@gmail.com> (raw)
In-Reply-To: <1221392158-3848-1-git-send-email-petkovbb@gmail.com>
This is a short-term-use one and will be removed later - it is added to solely
improve readability.
There should be no functional change resulting from this patch.
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
---
drivers/ide/ide-atapi.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c
index 7045d34..e1fa52d 100644
--- a/drivers/ide/ide-atapi.c
+++ b/drivers/ide/ide-atapi.c
@@ -477,6 +477,9 @@ static int ide_delayed_transfer_pc(ide_drive_t *drive)
return WAIT_FLOPPY_CMD;
}
+#define DEV_IS_IDECD(drive) \
+ (drive->media == ide_cdrom || drive->media == ide_optical)
+
static ide_startstop_t ide_transfer_pc(ide_drive_t *drive)
{
struct ide_atapi_pc *pc = drive->pc;
@@ -487,7 +490,7 @@ static ide_startstop_t ide_transfer_pc(ide_drive_t *drive)
ide_startstop_t startstop;
u8 ireason;
- if ((drive->media == ide_cdrom || drive->media == ide_optical) &&
+ if (DEV_IS_IDECD(drive) &&
(drive->atapi_flags & IDE_AFLAG_DRQ_INTERRUPT)) {
if (drive->dma)
drive->waiting_for_dma = 1;
@@ -561,7 +564,7 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive, unsigned int timeout,
/* Request to transfer the entire buffer at once */
if (drive->media == ide_tape && scsi == 0)
bcount = pc->req_xfer;
- else if (drive->media == ide_cdrom || drive->media == ide_optical)
+ else if (DEV_IS_IDECD(drive))
bcount = xferlen;
else
bcount = min(pc->req_xfer, 63 * 1024);
@@ -573,8 +576,7 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive, unsigned int timeout,
if (((pc->flags & PC_FLAG_DMA_OK) &&
(drive->dev_flags & IDE_DFLAG_USING_DMA)) ||
- ((drive->media == ide_cdrom || drive->media == ide_optical) &&
- drive->dma)) {
+ (DEV_IS_IDECD(drive) && drive->dma)) {
if (scsi)
hwif->sg_mapped = 1;
drive->dma = !hwif->dma_ops->dma_setup(drive);
@@ -587,7 +589,7 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive, unsigned int timeout,
if (scsi)
tf_flags = 0;
- else if (drive->media == ide_cdrom || drive->media == ide_optical)
+ else if (DEV_IS_IDECD(drive))
tf_flags = IDE_TFLAG_OUT_NSECT | IDE_TFLAG_OUT_LBAL;
else
tf_flags = IDE_TFLAG_OUT_DEVICE;
--
1.5.5.1
WARNING: multiple messages have this Message-ID (diff)
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 06/10] ide-atapi: add a DEV_IS_IDECD macro
Date: Sun, 14 Sep 2008 13:35:54 +0200 [thread overview]
Message-ID: <1221392158-3848-7-git-send-email-petkovbb@gmail.com> (raw)
In-Reply-To: <1221392158-3848-1-git-send-email-petkovbb@gmail.com>
This is a short-term-use one and will be removed later - it is added to solely
improve readability.
There should be no functional change resulting from this patch.
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
---
drivers/ide/ide-atapi.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c
index 7045d34..e1fa52d 100644
--- a/drivers/ide/ide-atapi.c
+++ b/drivers/ide/ide-atapi.c
@@ -477,6 +477,9 @@ static int ide_delayed_transfer_pc(ide_drive_t *drive)
return WAIT_FLOPPY_CMD;
}
+#define DEV_IS_IDECD(drive) \
+ (drive->media == ide_cdrom || drive->media == ide_optical)
+
static ide_startstop_t ide_transfer_pc(ide_drive_t *drive)
{
struct ide_atapi_pc *pc = drive->pc;
@@ -487,7 +490,7 @@ static ide_startstop_t ide_transfer_pc(ide_drive_t *drive)
ide_startstop_t startstop;
u8 ireason;
- if ((drive->media == ide_cdrom || drive->media == ide_optical) &&
+ if (DEV_IS_IDECD(drive) &&
(drive->atapi_flags & IDE_AFLAG_DRQ_INTERRUPT)) {
if (drive->dma)
drive->waiting_for_dma = 1;
@@ -561,7 +564,7 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive, unsigned int timeout,
/* Request to transfer the entire buffer at once */
if (drive->media == ide_tape && scsi == 0)
bcount = pc->req_xfer;
- else if (drive->media == ide_cdrom || drive->media == ide_optical)
+ else if (DEV_IS_IDECD(drive))
bcount = xferlen;
else
bcount = min(pc->req_xfer, 63 * 1024);
@@ -573,8 +576,7 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive, unsigned int timeout,
if (((pc->flags & PC_FLAG_DMA_OK) &&
(drive->dev_flags & IDE_DFLAG_USING_DMA)) ||
- ((drive->media == ide_cdrom || drive->media == ide_optical) &&
- drive->dma)) {
+ (DEV_IS_IDECD(drive) && drive->dma)) {
if (scsi)
hwif->sg_mapped = 1;
drive->dma = !hwif->dma_ops->dma_setup(drive);
@@ -587,7 +589,7 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive, unsigned int timeout,
if (scsi)
tf_flags = 0;
- else if (drive->media == ide_cdrom || drive->media == ide_optical)
+ else if (DEV_IS_IDECD(drive))
tf_flags = IDE_TFLAG_OUT_NSECT | IDE_TFLAG_OUT_LBAL;
else
tf_flags = IDE_TFLAG_OUT_DEVICE;
--
1.5.5.1
next prev parent reply other threads:[~2008-09-14 11:36 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-14 11:35 [PATCH 00/10] ide-cd: use generic ide_issue_pc Borislav Petkov
2008-09-14 11:35 ` Borislav Petkov
2008-09-14 11:35 ` [PATCH 01/10] ide: add ide_drive_t.dma flag Borislav Petkov
2008-09-14 11:35 ` Borislav Petkov
2008-09-15 17:51 ` Bartlomiej Zolnierkiewicz
2008-09-14 11:35 ` [PATCH 02/10] ide-cd: move cdrom_info.dma to ide_drive_t.dma Borislav Petkov
2008-09-14 11:35 ` Borislav Petkov
2008-09-15 17:54 ` Bartlomiej Zolnierkiewicz
2008-09-14 11:35 ` [PATCH 03/10] ide-atapi: teach ide atapi about drive->waiting_for_dma Borislav Petkov
2008-09-14 11:35 ` Borislav Petkov
2008-09-15 18:15 ` Bartlomiej Zolnierkiewicz
2008-09-17 10:05 ` Borislav Petkov
2008-09-17 16:32 ` Bartlomiej Zolnierkiewicz
2008-09-14 11:35 ` [PATCH 04/10] ide-atapi: assign taskfile flags per device type Borislav Petkov
2008-09-14 11:35 ` Borislav Petkov
2008-09-15 17:54 ` Bartlomiej Zolnierkiewicz
2008-09-14 11:35 ` [PATCH 05/10] ide-atapi: accomodate transfer length to ide-cd Borislav Petkov
2008-09-14 11:35 ` Borislav Petkov
2008-09-15 18:15 ` Bartlomiej Zolnierkiewicz
2008-09-14 11:35 ` Borislav Petkov [this message]
2008-09-14 11:35 ` [PATCH 06/10] ide-atapi: add a DEV_IS_IDECD macro Borislav Petkov
2008-09-15 18:19 ` Bartlomiej Zolnierkiewicz
2008-09-14 11:35 ` [PATCH 07/10] ide-atapi: prepare ide-cd expiry handler Borislav Petkov
2008-09-14 11:35 ` Borislav Petkov
2008-09-15 18:25 ` Bartlomiej Zolnierkiewicz
2008-09-14 11:35 ` [PATCH 08/10] ide-atapi: accomodate to ide-cd-specific handlers Borislav Petkov
2008-09-14 11:35 ` Borislav Petkov
2008-09-14 11:35 ` [PATCH 09/10] ide-atapi: protect ide_atapi_pc pointer from ide-cd code path Borislav Petkov
2008-09-14 11:35 ` Borislav Petkov
2008-09-14 11:35 ` [PATCH 10/10] ide-cd: use generic ide_issue_pc Borislav Petkov
2008-09-14 11:35 ` Borislav Petkov
2008-09-15 18:30 ` [PATCH 00/10] " 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=1221392158-3848-7-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 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.