From 6a7322df2c2825bb2f45d247432a3b7d3f3ed233 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Thu, 6 Feb 2020 17:31:51 +0100
Subject: [PATCH] ALSA: emu10k1: Fix endianness annotations
Git-commit: 6a7322df2c2825bb2f45d247432a3b7d3f3ed233
Patch-mainline: v5.7-rc1
References: bsc#1051510
The internal page tables are little endian, hence they should be
__le32 type. This fixes the relevant sparse warning:
sound/pci/emu10k1/emu10k1_main.c:2013:51: warning: incorrect type in assignment (different base types)
sound/pci/emu10k1/emu10k1_main.c:2013:51: expected unsigned int [usertype]
sound/pci/emu10k1/emu10k1_main.c:2013:51: got restricted __le32 [usertype]
No functional changes, just sparse warning fixes.
Link: https://lore.kernel.org/r/20200206163152.6073-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
sound/pci/emu10k1/emu10k1_main.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/sound/pci/emu10k1/emu10k1_main.c
+++ b/sound/pci/emu10k1/emu10k1_main.c
@@ -1804,6 +1804,7 @@ int snd_emu10k1_create(struct snd_card *
int idx, err;
int is_audigy;
size_t page_table_size;
+ __le32 *pgtbl;
unsigned int silent_page;
const struct snd_emu_chip_details *c;
static struct snd_device_ops ops = {
@@ -2022,8 +2023,9 @@ int snd_emu10k1_create(struct snd_card *
/* Clear silent pages and set up pointers */
memset(emu->silent_page.area, 0, emu->silent_page.bytes);
silent_page = emu->silent_page.addr << emu->address_mode;
+ pgtbl = (__le32 *)emu->ptb_pages.area;
for (idx = 0; idx < (emu->address_mode ? MAXPAGES1 : MAXPAGES0); idx++)
- ((u32 *)emu->ptb_pages.area)[idx] = cpu_to_le32(silent_page | idx);
+ pgtbl[idx] = cpu_to_le32(silent_page | idx);
/* set up voice indices */
for (idx = 0; idx < NUM_G; idx++) {