Skip to content

Commit 6479c9e

Browse files
tiwaigregkh
authored andcommitted
ALSA: cs5535audio: Fix invalid endian conversion
commit 69756930f2de0457d51db7d505a1e4f40e9fd116 upstream. One place in cs5535audio_build_dma_packets() does an extra conversion via cpu_to_le32(); namely jmpprd_addr is passed to setup_prd() ops, which writes the value via cs_writel(). That is, the callback does the conversion by itself, and we don't need to convert beforehand. This patch fixes that bogus conversion. Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent b1e4b1c commit 6479c9e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

sound/pci/cs5535audio/cs5535audio.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ struct cs5535audio_dma_ops {
6666
};
6767

6868
struct cs5535audio_dma_desc {
69-
u32 addr;
70-
u16 size;
71-
u16 ctlreserved;
69+
__le32 addr;
70+
__le16 size;
71+
__le16 ctlreserved;
7272
};
7373

7474
struct cs5535audio_dma {

sound/pci/cs5535audio/cs5535audio_pcm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ static int cs5535audio_build_dma_packets(struct cs5535audio *cs5535au,
158158
lastdesc->addr = cpu_to_le32((u32) dma->desc_buf.addr);
159159
lastdesc->size = 0;
160160
lastdesc->ctlreserved = cpu_to_le16(PRD_JMP);
161-
jmpprd_addr = cpu_to_le32(lastdesc->addr +
162-
(sizeof(struct cs5535audio_dma_desc)*periods));
161+
jmpprd_addr = (u32)dma->desc_buf.addr +
162+
sizeof(struct cs5535audio_dma_desc) * periods;
163163

164164
dma->substream = substream;
165165
dma->period_bytes = period_bytes;

0 commit comments

Comments
 (0)