diff options
author | Takashi Iwai <tiwai@suse.de> | 2018-07-26 00:24:05 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2018-07-27 10:06:03 +0300 |
commit | 0e7ca66a97c3bbf0b7665010d1b1d6a8c8e3811e (patch) | |
tree | 53c3a4c66724321a65392f8a776e3ba502390a24 /sound/pci/mixart/mixart_core.c | |
parent | be05e3de3a933156d472127f659d4473c461dcc5 (diff) | |
download | linux-0e7ca66a97c3bbf0b7665010d1b1d6a8c8e3811e.tar.xz |
ALSA: mixart: Proper endian notations
The miXart driver deals with big-endian values as raw data, while it
declares most of variables as u32. This leads to sparse warnings like
sound/pci/mixart/mixart.c:1203:23: warning: cast to restricted __be32
Fix them by properly defining the structs and add the explicit cast to
macros.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/mixart/mixart_core.c')
-rw-r--r-- | sound/pci/mixart/mixart_core.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/pci/mixart/mixart_core.c b/sound/pci/mixart/mixart_core.c index 8bf2ce32d4a8..46c292b52fd6 100644 --- a/sound/pci/mixart/mixart_core.c +++ b/sound/pci/mixart/mixart_core.c @@ -107,7 +107,7 @@ static int get_msg(struct mixart_mgr *mgr, struct mixart_msg *resp, #ifndef __BIG_ENDIAN size /= 4; /* u32 size */ for(i=0; i < size; i++) { - ((u32*)resp->data)[i] = be32_to_cpu(((u32*)resp->data)[i]); + ((u32*)resp->data)[i] = be32_to_cpu(((__be32*)resp->data)[i]); } #endif @@ -519,7 +519,7 @@ irqreturn_t snd_mixart_threaded_irq(int irq, void *dev_id) /* Traces are text: the swapped msg_data has to be swapped back ! */ int i; for(i=0; i<(resp.size/4); i++) { - (mixart_msg_data)[i] = cpu_to_be32((mixart_msg_data)[i]); + ((__be32*)mixart_msg_data)[i] = cpu_to_be32((mixart_msg_data)[i]); } #endif ((char*)mixart_msg_data)[resp.size - 1] = 0; |