]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ALSA: hda/ca0132 - Fix type of INVALID_CHIP_ADDRESS
authorTakashi Iwai <tiwai@suse.de>
Tue, 12 Feb 2013 09:15:15 +0000 (10:15 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 12 Feb 2013 09:15:15 +0000 (10:15 +0100)
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>
sound/pci/hda/ca0132_regs.h
sound/pci/hda/patch_ca0132.c

index 831ca9c47992ada7554dcd11421016d8b15547bc..07e760937d3c0fc83bc7214f775a3a621173bdc9 100644 (file)
 #define DSPDMAC_ACTIVE_WFR_MASK        0xFFF000
 
 #define DSP_AUX_MEM_BASE            0xE000
-#define INVALID_CHIP_ADDRESS        (~0UL)
+#define INVALID_CHIP_ADDRESS        (~0U)
 
 #define X_SIZE  (XRAM_XRAM_CHANNEL_COUNT   * XRAM_XRAM_CHAN_INCR)
 #define Y_SIZE  (YRAM_YRAM_CHANNEL_COUNT   * YRAM_YRAM_CHAN_INCR)
index b1e099a3369ce9ec9ac3e15a784c1ba0ae05e43d..fe07664b44b6921acda4ea4e72b6d4800eb2ec37 100644 (file)
@@ -1598,7 +1598,7 @@ static unsigned int dsp_chip_to_dsp_addx(unsigned int chip_addx,
                return Y_OFF(chip_addx);
        }
 
-       return (unsigned int)INVALID_CHIP_ADDRESS;
+       return INVALID_CHIP_ADDRESS;
 }
 
 /*
@@ -4540,7 +4540,7 @@ static int ca0132_init(struct hda_codec *codec)
        int i;
 
        spec->dsp_state = DSP_DOWNLOAD_INIT;
-       spec->curr_chip_addx = (unsigned int)INVALID_CHIP_ADDRESS;
+       spec->curr_chip_addx = INVALID_CHIP_ADDRESS;
 
        snd_hda_power_up(codec);