Skip to content

Commit

Permalink
ALSA: emu10k1: Fix endianness annotations
Browse files Browse the repository at this point in the history
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/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
tiwai committed Feb 10, 2020
1 parent c5bb086 commit 6a7322d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sound/pci/emu10k1/emu10k1_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1789,6 +1789,7 @@ int snd_emu10k1_create(struct snd_card *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 const struct snd_device_ops ops = {
Expand Down Expand Up @@ -2009,8 +2010,9 @@ int snd_emu10k1_create(struct snd_card *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++) {
Expand Down

0 comments on commit 6a7322d

Please sign in to comment.