Skip to contentSkip to conversation

i2c: cs8427.c use put_unaligned helper

PATCH Applied Harvey Harrison 2 participants 2 messages May 7, 2008 – May 8, 2008 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c: cs8427.c use put_unaligned helper

---
 sound/i2c/cs8427.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
sound/i2c/cs8427.c +2 -4
index e57e9cb..9c3d361 100644
@@ -23,6 +23,7 @@
 #include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/init.h>
+#include <asm/unaligned.h>
 #include <sound/core.h>
 #include <sound/control.h>
 #include <sound/pcm.h>
@@ -264,10 +265,7 @@ int snd_cs8427_create(struct snd_i2c_bus *bus,
 		goto __fail;
 	}
 	/* write default channel status bytes */
-	buf[0] = ((unsigned char)(SNDRV_PCM_DEFAULT_CON_SPDIF >> 0));
-	buf[1] = ((unsigned char)(SNDRV_PCM_DEFAULT_CON_SPDIF >> 8));
-	buf[2] = ((unsigned char)(SNDRV_PCM_DEFAULT_CON_SPDIF >> 16));
-	buf[3] = ((unsigned char)(SNDRV_PCM_DEFAULT_CON_SPDIF >> 24));
+	put_unaligned_le32(SNDRV_PCM_DEFAULT_CON_SPDIF, buf);
 	memset(buf + 4, 0, 24 - 4);
 	if (snd_cs8427_send_corudata(device, 0, buf, 24) < 0)
 		goto __fail;
Signature · 1 line
1.5.5.1.404.g981f6
Applied
#1 lore raw

At Wed, 07 May 2008 12:59:27 -0700,

Quoted 2 lines · Harvey Harrison

Thanks, applied to ALSA tree.

Takashi

Quoted 33 lines
---
 sound/i2c/cs8427.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
sound/i2c/cs8427.c +2 -4
index e57e9cb..9c3d361 100644
@@ -23,6 +23,7 @@
 #include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/init.h>
+#include <asm/unaligned.h>
 #include <sound/core.h>
 #include <sound/control.h>
 #include <sound/pcm.h>
@@ -264,10 +265,7 @@ int snd_cs8427_create(struct snd_i2c_bus *bus,
 		goto __fail;
 	}
 	/* write default channel status bytes */
-	buf[0] = ((unsigned char)(SNDRV_PCM_DEFAULT_CON_SPDIF >> 0));
-	buf[1] = ((unsigned char)(SNDRV_PCM_DEFAULT_CON_SPDIF >> 8));
-	buf[2] = ((unsigned char)(SNDRV_PCM_DEFAULT_CON_SPDIF >> 16));
-	buf[3] = ((unsigned char)(SNDRV_PCM_DEFAULT_CON_SPDIF >> 24));
+	put_unaligned_le32(SNDRV_PCM_DEFAULT_CON_SPDIF, buf);
 	memset(buf + 4, 0, 24 - 4);
 	if (snd_cs8427_send_corudata(device, 0, buf, 24) < 0)
 		goto __fail;
Signature · 1 line
1.5.5.1.404.g981f6