* [patch] ALSA: cs5535 - Fix an endianness conversion
@ 2011-11-20 20:57 Dan Carpenter
2011-11-21 11:39 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2011-11-20 20:57 UTC (permalink / raw)
To: Jaya Kumar; +Cc: Takashi Iwai, alsa-devel, kernel-janitors
desc->size is supposed to be a le16 type. On a big endian system the
current code will set ->size to zero. We fixed a similar bug
on the next line but missed this one.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
This is a static checker bug. I haven't tested it.
diff --git a/sound/pci/cs5535audio/cs5535audio_pcm.c b/sound/pci/cs5535audio/cs5535audio_pcm.c
index e083122..dbf94b1 100644
--- a/sound/pci/cs5535audio/cs5535audio_pcm.c
+++ b/sound/pci/cs5535audio/cs5535audio_pcm.c
@@ -148,7 +148,7 @@ static int cs5535audio_build_dma_packets(struct cs5535audio *cs5535au,
struct cs5535audio_dma_desc *desc &((struct cs5535audio_dma_desc *) dma->desc_buf.area)[i];
desc->addr = cpu_to_le32(addr);
- desc->size = cpu_to_le32(period_bytes);
+ desc->size = cpu_to_le16(period_bytes);
desc->ctlreserved = cpu_to_le16(PRD_EOP);
desc_addr += sizeof(struct cs5535audio_dma_desc);
addr += period_bytes;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] ALSA: cs5535 - Fix an endianness conversion
2011-11-20 20:57 [patch] ALSA: cs5535 - Fix an endianness conversion Dan Carpenter
@ 2011-11-21 11:39 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2011-11-21 11:39 UTC (permalink / raw)
To: Dan Carpenter; +Cc: alsa-devel, kernel-janitors, Jaya Kumar
At Sun, 20 Nov 2011 23:57:49 +0300,
Dan Carpenter wrote:
>
> desc->size is supposed to be a le16 type. On a big endian system the
> current code will set ->size to zero. We fixed a similar bug
> on the next line but missed this one.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> This is a static checker bug. I haven't tested it.
Obviously correct, so I applied it now.
thanks,
Takashi
> diff --git a/sound/pci/cs5535audio/cs5535audio_pcm.c b/sound/pci/cs5535audio/cs5535audio_pcm.c
> index e083122..dbf94b1 100644
> --- a/sound/pci/cs5535audio/cs5535audio_pcm.c
> +++ b/sound/pci/cs5535audio/cs5535audio_pcm.c
> @@ -148,7 +148,7 @@ static int cs5535audio_build_dma_packets(struct cs5535audio *cs5535au,
> struct cs5535audio_dma_desc *desc > &((struct cs5535audio_dma_desc *) dma->desc_buf.area)[i];
> desc->addr = cpu_to_le32(addr);
> - desc->size = cpu_to_le32(period_bytes);
> + desc->size = cpu_to_le16(period_bytes);
> desc->ctlreserved = cpu_to_le16(PRD_EOP);
> desc_addr += sizeof(struct cs5535audio_dma_desc);
> addr += period_bytes;
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-11-21 11:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-20 20:57 [patch] ALSA: cs5535 - Fix an endianness conversion Dan Carpenter
2011-11-21 11:39 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox