summaryrefslogtreecommitdiff
path: root/drivers/platform
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-10-24 14:06:32 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-11-29 19:27:54 (GMT)
commitce0b80a71ba1a749abaffa5e5883582d54ffe66e (patch)
treec2c01b49c961fc87a103e8a9e8ec792126ac289b /drivers/platform
parent0bb8c8db22da5810c13974d5a8df4595a654541c (diff)
downloadlinux-fsl-qoriq-ce0b80a71ba1a749abaffa5e5883582d54ffe66e.tar.xz
thinkpad_acpi: Fix build error when CONFIG_SND_MAX_CARDS > 32
commit cab6661344f14a09d7aecdf821a40f68ef9b18cc upstream. 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. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/thinkpad_acpi.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 03ca6c1..4e86e97 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -6420,7 +6420,12 @@ static struct ibm_struct brightness_driver_data = {
#define TPACPI_ALSA_SHRTNAME "ThinkPad Console Audio Control"
#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 bool alsa_enable = SNDRV_DEFAULT_ENABLE1;