From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: linux-ide@vger.kernel.org
Subject: Re: [PATCH 1/13] serverworks: cleanup ->set_dma_mode method
Date: Tue, 13 Nov 2007 14:32:53 +0300 [thread overview]
Message-ID: <47398B65.7090409@ru.mvista.com> (raw)
In-Reply-To: <200711130001.16287.bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz wrote:
> IDE core guarantees that ->set_dma_mode will be called only
> for DMA modes set in SWDMA/MWDMA/UDMA masks.
> There should be no functionality changes caused by this patch.
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> Index: b/drivers/ide/pci/serverworks.c
> ===================================================================
> --- a/drivers/ide/pci/serverworks.c
> +++ b/drivers/ide/pci/serverworks.c
> @@ -164,25 +164,12 @@ static void svwks_set_dma_mode(ide_drive
> ultra_timing &= ~(0x0F << (4*unit));
> ultra_enable &= ~(0x01 << drive->dn);
>
> - switch(speed) {
> - case XFER_MW_DMA_2:
> - case XFER_MW_DMA_1:
> - case XFER_MW_DMA_0:
> - dma_timing |= dma_modes[speed - XFER_MW_DMA_0];
> - break;
> -
> - case XFER_UDMA_5:
> - case XFER_UDMA_4:
> - case XFER_UDMA_3:
> - case XFER_UDMA_2:
> - case XFER_UDMA_1:
> - case XFER_UDMA_0:
> - dma_timing |= dma_modes[2];
Why it needs to change in the first place?
> - ultra_timing |= ((udma_modes[speed - XFER_UDMA_0]) << (4*unit));
> - ultra_enable |= (0x01 << drive->dn);
> - default:
> - break;
> - }
> + if (speed >= XFER_UDMA_0) {
> + dma_timing |= dma_modes[2];
> + ultra_timing |= (udma_modes[speed - XFER_UDMA_0] << (4 * unit));
> + ultra_enable |= (0x01 << drive->dn);
> + } else if (speed >= XFER_MW_DMA_0)
> + dma_timing |= dma_modes[speed - XFER_MW_DMA_0];
>
> pci_write_config_byte(dev, drive_pci2[drive->dn], dma_timing);
> pci_write_config_byte(dev, (0x56|hwif->channel), ultra_timing);
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
MBR, Sergei
next prev parent reply other threads:[~2007-11-13 11:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-12 23:01 [PATCH 1/13] serverworks: cleanup ->set_dma_mode method Bartlomiej Zolnierkiewicz
2007-11-13 11:32 ` Sergei Shtylyov [this message]
2007-11-13 21:26 ` 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=47398B65.7090409@ru.mvista.com \
--to=sshtylyov@ru.mvista.com \
--cc=bzolnier@gmail.com \
--cc=linux-ide@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.