* [PATCH] thinkpad_acpi: Fix build error when CONFIG_SND_MAX_CARDS > 32
@ 2013-10-24 14:06 Takashi Iwai
2013-10-24 16:33 ` Henrique de Moraes Holschuh
2013-11-20 23:52 ` Matthew Garrett
0 siblings, 2 replies; 3+ messages in thread
From: Takashi Iwai @ 2013-10-24 14:06 UTC (permalink / raw)
To: Henrique de Moraes Holschuh
Cc: Matthew Garrett, ibm-acpi-devel, platform-driver-x86,
linux-kernel
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>
---
drivers/platform/x86/thinkpad_acpi.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 0b7efb2..79f77a7 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -6421,7 +6421,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;
--
1.8.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] thinkpad_acpi: Fix build error when CONFIG_SND_MAX_CARDS > 32
2013-10-24 14:06 [PATCH] thinkpad_acpi: Fix build error when CONFIG_SND_MAX_CARDS > 32 Takashi Iwai
@ 2013-10-24 16:33 ` Henrique de Moraes Holschuh
2013-11-20 23:52 ` Matthew Garrett
1 sibling, 0 replies; 3+ messages in thread
From: Henrique de Moraes Holschuh @ 2013-10-24 16:33 UTC (permalink / raw)
To: Takashi Iwai
Cc: Henrique de Moraes Holschuh, Matthew Garrett, ibm-acpi-devel,
platform-driver-x86, linux-kernel
On Thu, 24 Oct 2013, Takashi Iwai wrote:
> 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>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
--
"One disk to rule them all, One disk to find them. One disk to bring
them all and in the darkness grind them. In the Land of Redmond
where the shadows lie." -- The Silicon Valley Tarot
Henrique Holschuh
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] thinkpad_acpi: Fix build error when CONFIG_SND_MAX_CARDS > 32
2013-10-24 14:06 [PATCH] thinkpad_acpi: Fix build error when CONFIG_SND_MAX_CARDS > 32 Takashi Iwai
2013-10-24 16:33 ` Henrique de Moraes Holschuh
@ 2013-11-20 23:52 ` Matthew Garrett
1 sibling, 0 replies; 3+ messages in thread
From: Matthew Garrett @ 2013-11-20 23:52 UTC (permalink / raw)
To: tiwai@suse.de
Cc: ibm-acpi-devel@lists.sourceforge.net,
platform-driver-x86@vger.kernel.org, ibm-acpi@hmh.eng.br,
linux-kernel@vger.kernel.org
Applied, thanks.
--
Matthew Garrett <matthew.garrett@nebula.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-11-20 23:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-24 14:06 [PATCH] thinkpad_acpi: Fix build error when CONFIG_SND_MAX_CARDS > 32 Takashi Iwai
2013-10-24 16:33 ` Henrique de Moraes Holschuh
2013-11-20 23:52 ` Matthew Garrett
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox