Skip to content

Commit

Permalink
thinkpad_acpi: Fix build error when CONFIG_SND_MAX_CARDS > 32
Browse files Browse the repository at this point in the history
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: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
  • Loading branch information
Takashi Iwai authored and Matthew Garrett committed Nov 20, 2013
1 parent ab04310 commit cab6661
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/platform/x86/thinkpad_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -6438,7 +6438,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;

Expand Down

0 comments on commit cab6661

Please sign in to comment.