Commit 3acd3e3b authored by Takashi Iwai's avatar Takashi Iwai

ALSA: vxpocket: Fix invalid endian conversions

The endian conversions used in vxp_dma_read() and vxp_dma_write() are
superfluous and even wrong on big-endian machines, as inw() and outw()
already do conversions.  Kill them.

Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent fff71a4c
...@@ -375,7 +375,7 @@ static void vxp_dma_write(struct vx_core *chip, struct snd_pcm_runtime *runtime, ...@@ -375,7 +375,7 @@ static void vxp_dma_write(struct vx_core *chip, struct snd_pcm_runtime *runtime,
length >>= 1; /* in 16bit words */ length >>= 1; /* in 16bit words */
/* Transfer using pseudo-dma. */ /* Transfer using pseudo-dma. */
for (; length > 0; length--) { for (; length > 0; length--) {
outw(cpu_to_le16(*addr), port); outw(*addr, port);
addr++; addr++;
} }
addr = (unsigned short *)runtime->dma_area; addr = (unsigned short *)runtime->dma_area;
...@@ -385,7 +385,7 @@ static void vxp_dma_write(struct vx_core *chip, struct snd_pcm_runtime *runtime, ...@@ -385,7 +385,7 @@ static void vxp_dma_write(struct vx_core *chip, struct snd_pcm_runtime *runtime,
count >>= 1; /* in 16bit words */ count >>= 1; /* in 16bit words */
/* Transfer using pseudo-dma. */ /* Transfer using pseudo-dma. */
for (; count > 0; count--) { for (; count > 0; count--) {
outw(cpu_to_le16(*addr), port); outw(*addr, port);
addr++; addr++;
} }
vx_release_pseudo_dma(chip); vx_release_pseudo_dma(chip);
...@@ -417,7 +417,7 @@ static void vxp_dma_read(struct vx_core *chip, struct snd_pcm_runtime *runtime, ...@@ -417,7 +417,7 @@ static void vxp_dma_read(struct vx_core *chip, struct snd_pcm_runtime *runtime,
length >>= 1; /* in 16bit words */ length >>= 1; /* in 16bit words */
/* Transfer using pseudo-dma. */ /* Transfer using pseudo-dma. */
for (; length > 0; length--) for (; length > 0; length--)
*addr++ = le16_to_cpu(inw(port)); *addr++ = inw(port);
addr = (unsigned short *)runtime->dma_area; addr = (unsigned short *)runtime->dma_area;
pipe->hw_ptr = 0; pipe->hw_ptr = 0;
} }
...@@ -425,12 +425,12 @@ static void vxp_dma_read(struct vx_core *chip, struct snd_pcm_runtime *runtime, ...@@ -425,12 +425,12 @@ static void vxp_dma_read(struct vx_core *chip, struct snd_pcm_runtime *runtime,
count >>= 1; /* in 16bit words */ count >>= 1; /* in 16bit words */
/* Transfer using pseudo-dma. */ /* Transfer using pseudo-dma. */
for (; count > 1; count--) for (; count > 1; count--)
*addr++ = le16_to_cpu(inw(port)); *addr++ = inw(port);
/* Disable DMA */ /* Disable DMA */
pchip->regDIALOG &= ~VXP_DLG_DMAREAD_SEL_MASK; pchip->regDIALOG &= ~VXP_DLG_DMAREAD_SEL_MASK;
vx_outb(chip, DIALOG, pchip->regDIALOG); vx_outb(chip, DIALOG, pchip->regDIALOG);
/* Read the last word (16 bits) */ /* Read the last word (16 bits) */
*addr = le16_to_cpu(inw(port)); *addr = inw(port);
/* Disable 16-bit accesses */ /* Disable 16-bit accesses */
pchip->regDIALOG &= ~VXP_DLG_DMA16_SEL_MASK; pchip->regDIALOG &= ~VXP_DLG_DMA16_SEL_MASK;
vx_outb(chip, DIALOG, pchip->regDIALOG); vx_outb(chip, DIALOG, pchip->regDIALOG);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment