Commit 4a8b89f99534af1deaae73679797c27e77661ef0

Authored by Takashi Iwai
1 parent d911149625

ALSA: hda/ca0132 - Fix type of INVALID_CHIP_ADDRESS

The chip address is 32bit long but INVALID_CHIP_ADDRESS is defined as
an unsigned long.  This makes dsp_chip_to_dsp_addx() misbehaving on
64bit architectures.  Fix the INVALID_CHIP_ADDRESS definition to be
32bit.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

Showing 2 changed files with 3 additions and 3 deletions Side-by-side Diff

sound/pci/hda/ca0132_regs.h
... ... @@ -337,7 +337,7 @@
337 337 #define DSPDMAC_ACTIVE_WFR_MASK 0xFFF000
338 338  
339 339 #define DSP_AUX_MEM_BASE 0xE000
340   -#define INVALID_CHIP_ADDRESS (~0UL)
  340 +#define INVALID_CHIP_ADDRESS (~0U)
341 341  
342 342 #define X_SIZE (XRAM_XRAM_CHANNEL_COUNT * XRAM_XRAM_CHAN_INCR)
343 343 #define Y_SIZE (YRAM_YRAM_CHANNEL_COUNT * YRAM_YRAM_CHAN_INCR)
sound/pci/hda/patch_ca0132.c
... ... @@ -1598,7 +1598,7 @@
1598 1598 return Y_OFF(chip_addx);
1599 1599 }
1600 1600  
1601   - return (unsigned int)INVALID_CHIP_ADDRESS;
  1601 + return INVALID_CHIP_ADDRESS;
1602 1602 }
1603 1603  
1604 1604 /*
... ... @@ -4540,7 +4540,7 @@
4540 4540 int i;
4541 4541  
4542 4542 spec->dsp_state = DSP_DOWNLOAD_INIT;
4543   - spec->curr_chip_addx = (unsigned int)INVALID_CHIP_ADDRESS;
  4543 + spec->curr_chip_addx = INVALID_CHIP_ADDRESS;
4544 4544  
4545 4545 snd_hda_power_up(codec);
4546 4546