Commit cab66613 authored by Takashi Iwai's avatar Takashi Iwai Committed by Matthew Garrett

thinkpad_acpi: Fix build error when CONFIG_SND_MAX_CARDS > 32

SNDRV_CARDS can be specified via Kconfig since 3.11 kernel, so this
can be over 32bit integer range, which leads to a build error.

Cc: <stable@vger.kernel.org> [v3.11+]
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarMatthew Garrett <matthew.garrett@nebula.com>
parent ab043105
...@@ -6438,7 +6438,12 @@ static struct ibm_struct brightness_driver_data = { ...@@ -6438,7 +6438,12 @@ static struct ibm_struct brightness_driver_data = {
#define TPACPI_ALSA_SHRTNAME "ThinkPad Console Audio Control" #define TPACPI_ALSA_SHRTNAME "ThinkPad Console Audio Control"
#define TPACPI_ALSA_MIXERNAME TPACPI_ALSA_SHRTNAME #define TPACPI_ALSA_MIXERNAME TPACPI_ALSA_SHRTNAME
static int alsa_index = ~((1 << (SNDRV_CARDS - 3)) - 1); /* last three slots */ #if SNDRV_CARDS <= 32
#define DEFAULT_ALSA_IDX ~((1 << (SNDRV_CARDS - 3)) - 1)
#else
#define DEFAULT_ALSA_IDX ~((1 << (32 - 3)) - 1)
#endif
static int alsa_index = DEFAULT_ALSA_IDX; /* last three slots */
static char *alsa_id = "ThinkPadEC"; static char *alsa_id = "ThinkPadEC";
static bool alsa_enable = SNDRV_DEFAULT_ENABLE1; static bool alsa_enable = SNDRV_DEFAULT_ENABLE1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment