Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fff71a4c authored by Takashi Iwai's avatar Takashi Iwai
Browse files

ALSA: vx222: Fix invalid endian conversions



The endian conversions used in vx2_dma_read() and vx2_dma_write() are
superfluous and even wrong on big-endian machines, as inl() and outl()
already do conversions.  Kill them.

Spotted by sparse, a warning like:
  sound/pci/vx222/vx222_ops.c:278:30: warning: incorrect type in argument 1 (different base types)

Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent a49a71f6
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -275,7 +275,7 @@ static void vx2_dma_write(struct vx_core *chip, struct snd_pcm_runtime *runtime,
		length >>= 2; /* in 32bit words */
		length >>= 2; /* in 32bit words */
		/* Transfer using pseudo-dma. */
		/* Transfer using pseudo-dma. */
		for (; length > 0; length--) {
		for (; length > 0; length--) {
			outl(cpu_to_le32(*addr), port);
			outl(*addr, port);
			addr++;
			addr++;
		}
		}
		addr = (u32 *)runtime->dma_area;
		addr = (u32 *)runtime->dma_area;
@@ -285,7 +285,7 @@ static void vx2_dma_write(struct vx_core *chip, struct snd_pcm_runtime *runtime,
	count >>= 2; /* in 32bit words */
	count >>= 2; /* in 32bit words */
	/* Transfer using pseudo-dma. */
	/* Transfer using pseudo-dma. */
	for (; count > 0; count--) {
	for (; count > 0; count--) {
		outl(cpu_to_le32(*addr), port);
		outl(*addr, port);
		addr++;
		addr++;
	}
	}


@@ -313,7 +313,7 @@ static void vx2_dma_read(struct vx_core *chip, struct snd_pcm_runtime *runtime,
		length >>= 2; /* in 32bit words */
		length >>= 2; /* in 32bit words */
		/* Transfer using pseudo-dma. */
		/* Transfer using pseudo-dma. */
		for (; length > 0; length--)
		for (; length > 0; length--)
			*addr++ = le32_to_cpu(inl(port));
			*addr++ = inl(port);
		addr = (u32 *)runtime->dma_area;
		addr = (u32 *)runtime->dma_area;
		pipe->hw_ptr = 0;
		pipe->hw_ptr = 0;
	}
	}
@@ -321,7 +321,7 @@ static void vx2_dma_read(struct vx_core *chip, struct snd_pcm_runtime *runtime,
	count >>= 2; /* in 32bit words */
	count >>= 2; /* in 32bit words */
	/* Transfer using pseudo-dma. */
	/* Transfer using pseudo-dma. */
	for (; count > 0; count--)
	for (; count > 0; count--)
		*addr++ = le32_to_cpu(inl(port));
		*addr++ = inl(port);


	vx2_release_pseudo_dma(chip);
	vx2_release_pseudo_dma(chip);
}
}