From: Jean Delvare <khali@linux-fr.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Dave Airlie <airlied@linux.ie>,
Christoph Lameter <clameter@sgi.com>,
kamalesh@linux.vnet.ibm.com, linux-kernel@vger.kernel.org,
bunk@kernel.org, apw@shadowen.org, balbir@linux.vnet.ibm.com
Subject: Fix for __you_cannot_kmalloc_that_much failure with gcc 3.2
Date: Tue, 8 Jan 2008 13:34:38 +0100 [thread overview]
Message-ID: <20080108133438.7d0b41f4@hyperion.delvare> (raw)
In-Reply-To: <20080108105609.197a2874@hyperion.delvare>
On Tue, 8 Jan 2008 10:56:09 +0100, Jean Delvare wrote:
> I'll now check if I can do something similar for snd-mixer-oss.
And here you go, this is a unified patch fixing both bugs. The dmi-id
part is unchanged. Testers and reviewers are welcome.
* * * * *
gcc 3.2 has a hard time coping with the code in dmi_id_init():
drivers/built-in.o(.init.text+0x789e): In function `dmi_id_init':
: undefined reference to `__you_cannot_kmalloc_that_much'
make: *** [.tmp_vmlinux1] Error 1
Moving half of the code to a separate function seems to help. This is
a no-op for gcc 4.1 which will successfully inline the code anyway.
Tested-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
A similar problem has been reported in snd_mixer_oss_build_input(),
fix it as well.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Dave Airlie <airlied@linux.ie>
---
drivers/firmware/dmi-id.c | 17 +++++--
sound/core/oss/mixer_oss.c | 101 +++++++++++++++++++++++++++-----------------
2 files changed, 75 insertions(+), 43 deletions(-)
--- linux-2.6.24-rc7.orig/drivers/firmware/dmi-id.c 2008-01-08 12:57:48.000000000 +0100
+++ linux-2.6.24-rc7/drivers/firmware/dmi-id.c 2008-01-08 13:06:15.000000000 +0100
@@ -175,12 +175,9 @@ static struct device *dmi_dev;
extern int dmi_available;
-static int __init dmi_id_init(void)
+static void __init dmi_id_init_attr_table(void)
{
- int ret, i;
-
- if (!dmi_available)
- return -ENODEV;
+ int i;
/* Not necessarily all DMI fields are available on all
* systems, hence let's built an attribute table of just
@@ -205,6 +202,16 @@ static int __init dmi_id_init(void)
ADD_DMI_ATTR(chassis_serial, DMI_CHASSIS_SERIAL);
ADD_DMI_ATTR(chassis_asset_tag, DMI_CHASSIS_ASSET_TAG);
sys_dmi_attributes[i++] = &sys_dmi_modalias_attr.attr;
+}
+
+static int __init dmi_id_init(void)
+{
+ int ret;
+
+ if (!dmi_available)
+ return -ENODEV;
+
+ dmi_id_init_attr_table();
ret = class_register(&dmi_class);
if (ret)
--- linux-2.6.24-rc7.orig/sound/core/oss/mixer_oss.c 2008-01-08 12:57:48.000000000 +0100
+++ linux-2.6.24-rc7/sound/core/oss/mixer_oss.c 2008-01-08 13:21:12.000000000 +0100
@@ -925,6 +925,68 @@ static void mixer_slot_clear(struct snd_
rslot->number = idx;
}
+/* In a separate function to keep gcc 3.2 happy - do NOT merge this in
+ snd_mixer_oss_build_input! */
+static int snd_mixer_oss_build_test_all(struct snd_mixer_oss *mixer,
+ struct snd_mixer_oss_assign_table *ptr,
+ struct slot *slot)
+{
+ char str[64];
+ int err;
+
+ err = snd_mixer_oss_build_test(mixer, slot, ptr->name, ptr->index,
+ SNDRV_MIXER_OSS_ITEM_GLOBAL);
+ if (err)
+ return err;
+ sprintf(str, "%s Switch", ptr->name);
+ err = snd_mixer_oss_build_test(mixer, slot, str, ptr->index,
+ SNDRV_MIXER_OSS_ITEM_GSWITCH);
+ if (err)
+ return err;
+ sprintf(str, "%s Route", ptr->name);
+ err = snd_mixer_oss_build_test(mixer, slot, str, ptr->index,
+ SNDRV_MIXER_OSS_ITEM_GROUTE);
+ if (err)
+ return err;
+ sprintf(str, "%s Volume", ptr->name);
+ err = snd_mixer_oss_build_test(mixer, slot, str, ptr->index,
+ SNDRV_MIXER_OSS_ITEM_GVOLUME);
+ if (err)
+ return err;
+ sprintf(str, "%s Playback Switch", ptr->name);
+ err = snd_mixer_oss_build_test(mixer, slot, str, ptr->index,
+ SNDRV_MIXER_OSS_ITEM_PSWITCH);
+ if (err)
+ return err;
+ sprintf(str, "%s Playback Route", ptr->name);
+ err = snd_mixer_oss_build_test(mixer, slot, str, ptr->index,
+ SNDRV_MIXER_OSS_ITEM_PROUTE);
+ if (err)
+ return err;
+ sprintf(str, "%s Playback Volume", ptr->name);
+ err = snd_mixer_oss_build_test(mixer, slot, str, ptr->index,
+ SNDRV_MIXER_OSS_ITEM_PVOLUME);
+ if (err)
+ return err;
+ sprintf(str, "%s Capture Switch", ptr->name);
+ err = snd_mixer_oss_build_test(mixer, slot, str, ptr->index,
+ SNDRV_MIXER_OSS_ITEM_CSWITCH);
+ if (err)
+ return err;
+ sprintf(str, "%s Capture Route", ptr->name);
+ err = snd_mixer_oss_build_test(mixer, slot, str, ptr->index,
+ SNDRV_MIXER_OSS_ITEM_CROUTE);
+ if (err)
+ return err;
+ sprintf(str, "%s Capture Volume", ptr->name);
+ err = snd_mixer_oss_build_test(mixer, slot, str, ptr->index,
+ SNDRV_MIXER_OSS_ITEM_CVOLUME);
+ if (err)
+ return err;
+
+ return 0;
+}
+
/*
* build an OSS mixer element.
* ptr_allocated means the entry is dynamically allocated (change via proc file).
@@ -944,44 +1006,7 @@ static int snd_mixer_oss_build_input(str
memset(&slot, 0, sizeof(slot));
memset(slot.numid, 0xff, sizeof(slot.numid)); /* ID_UNKNOWN */
- if (snd_mixer_oss_build_test(mixer, &slot, ptr->name, ptr->index,
- SNDRV_MIXER_OSS_ITEM_GLOBAL))
- return 0;
- sprintf(str, "%s Switch", ptr->name);
- if (snd_mixer_oss_build_test(mixer, &slot, str, ptr->index,
- SNDRV_MIXER_OSS_ITEM_GSWITCH))
- return 0;
- sprintf(str, "%s Route", ptr->name);
- if (snd_mixer_oss_build_test(mixer, &slot, str, ptr->index,
- SNDRV_MIXER_OSS_ITEM_GROUTE))
- return 0;
- sprintf(str, "%s Volume", ptr->name);
- if (snd_mixer_oss_build_test(mixer, &slot, str, ptr->index,
- SNDRV_MIXER_OSS_ITEM_GVOLUME))
- return 0;
- sprintf(str, "%s Playback Switch", ptr->name);
- if (snd_mixer_oss_build_test(mixer, &slot, str, ptr->index,
- SNDRV_MIXER_OSS_ITEM_PSWITCH))
- return 0;
- sprintf(str, "%s Playback Route", ptr->name);
- if (snd_mixer_oss_build_test(mixer, &slot, str, ptr->index,
- SNDRV_MIXER_OSS_ITEM_PROUTE))
- return 0;
- sprintf(str, "%s Playback Volume", ptr->name);
- if (snd_mixer_oss_build_test(mixer, &slot, str, ptr->index,
- SNDRV_MIXER_OSS_ITEM_PVOLUME))
- return 0;
- sprintf(str, "%s Capture Switch", ptr->name);
- if (snd_mixer_oss_build_test(mixer, &slot, str, ptr->index,
- SNDRV_MIXER_OSS_ITEM_CSWITCH))
- return 0;
- sprintf(str, "%s Capture Route", ptr->name);
- if (snd_mixer_oss_build_test(mixer, &slot, str, ptr->index,
- SNDRV_MIXER_OSS_ITEM_CROUTE))
- return 0;
- sprintf(str, "%s Capture Volume", ptr->name);
- if (snd_mixer_oss_build_test(mixer, &slot, str, ptr->index,
- SNDRV_MIXER_OSS_ITEM_CVOLUME))
+ if (snd_mixer_oss_build_test_all(mixer, ptr, &slot))
return 0;
down_read(&mixer->card->controls_rwsem);
if (ptr->index == 0 && (kctl = snd_mixer_oss_test_id(mixer, "Capture Source", 0)) != NULL) {
--
Jean Delvare
next prev parent reply other threads:[~2008-01-08 12:34 UTC|newest]
Thread overview: 127+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-06 22:19 Linux 2.6.24-rc7 Linus Torvalds
2008-01-06 23:52 ` Mark Lord
2008-01-07 0:08 ` Linus Torvalds
2008-01-07 0:35 ` Tejun Heo
2008-01-07 8:48 ` Linux 2.6.24-rc7 Build Failure on headers_install Kamalesh Babulal
2008-01-07 10:12 ` Sam Ravnborg
2008-01-08 10:51 ` Kamalesh Babulal
2008-01-08 13:10 ` Sam Ravnborg
2008-01-07 10:36 ` Linux 2.6.24-rc7 Build-Failure at __you_cannot_kmalloc_that_much Kamalesh Babulal
2008-01-07 18:07 ` Andrew Morton
2008-01-07 18:31 ` Christoph Lameter
2008-01-07 19:38 ` Andrew Morton
2008-01-08 9:56 ` Jean Delvare
2008-01-08 10:44 ` Kamalesh Babulal
2008-01-08 12:34 ` Jean Delvare [this message]
2008-01-08 4:20 ` Arjan van de Ven
2008-01-08 5:23 ` Christoph Lameter
2008-01-08 8:20 ` Kamalesh Babulal
2008-01-08 9:27 ` Balbir Singh
2008-01-08 7:48 ` Jean Delvare
2008-01-07 12:13 ` Linux 2.6.24-rc7 kernel BUG at kernel/sched.c:5156! Kamalesh Babulal
2008-01-08 16:16 ` [powerpc crash] " Ingo Molnar
2008-01-07 15:53 ` Linux 2.6.24-rc7 Alejandro Riveira Fernández
2008-01-07 16:27 ` smpboot_64 section mismatch warning Sam Ravnborg
2008-01-07 23:27 ` David Howells
2008-01-08 9:14 ` Alejandro Riveira Fernández
2008-01-08 11:17 ` David Howells
2008-01-07 16:31 ` section mismatch warning in head_64.S Sam Ravnborg
2008-01-15 10:18 ` Alejandro Riveira Fernández
2008-01-07 16:14 ` Linux 2.6.24-rc7 Alejandro Riveira Fernández
2008-01-07 16:14 ` Alejandro Riveira Fernández
2008-01-07 16:24 ` Michael Buesch
2008-01-07 16:24 ` Michael Buesch
2008-01-07 16:52 ` Alejandro Riveira Fernández
2008-01-07 16:52 ` Alejandro Riveira Fernández
2008-01-07 17:30 ` Michael Buesch
2008-01-07 17:30 ` Michael Buesch
2008-01-07 20:23 ` Alejandro Riveira Fernández
2008-01-07 20:23 ` Alejandro Riveira Fernández
2008-01-08 15:30 ` Michael Buesch
2008-01-08 15:30 ` Michael Buesch
2008-01-08 15:55 ` Alejandro Riveira Fernández
2008-01-08 15:55 ` Alejandro Riveira Fernández
2008-01-24 20:27 ` Linus Torvalds
2008-01-24 21:07 ` John W. Linville
2008-01-24 21:34 ` Linus Torvalds
2008-01-25 12:29 ` Johannes Berg
2008-01-25 16:08 ` Linus Torvalds
2008-01-25 16:23 ` Michael Buesch
2008-01-25 16:43 ` Linus Torvalds
2008-01-25 17:27 ` Dan Williams
2008-01-25 17:38 ` Linus Torvalds
2008-01-25 17:42 ` Dan Williams
2008-02-05 20:55 ` Russell S. Senior
2008-01-25 18:22 ` Linus Torvalds
2008-01-25 18:30 ` Michael Buesch
2008-01-25 19:07 ` Linus Torvalds
2008-01-25 19:34 ` Michael Buesch
2008-01-25 19:48 ` John W. Linville
2008-01-25 19:50 ` John W. Linville
2008-01-25 21:18 ` John W. Linville
2008-01-25 21:56 ` Linus Torvalds
2008-01-25 22:46 ` John W. Linville
2008-01-25 23:20 ` Guy Cohen
2008-01-26 13:53 ` David Miller
2008-01-26 13:47 ` David Miller
2008-01-25 22:02 ` Guy Cohen
2008-01-26 13:40 ` David Miller
2008-01-25 20:28 ` Linus Torvalds
2008-01-26 13:37 ` David Miller
2008-01-27 6:32 ` Linus Torvalds
2008-01-27 7:16 ` Jeff Garzik
2008-01-27 7:24 ` David Miller
2008-01-27 7:54 ` Linus Torvalds
2008-01-28 3:15 ` David Miller
2008-01-25 23:22 ` Jeff Garzik
2008-01-26 13:27 ` David Miller
2008-01-27 6:25 ` Linus Torvalds
2008-01-26 13:22 ` David Miller
2008-01-25 18:21 ` Michael Buesch
2008-01-25 18:34 ` Linus Torvalds
2008-01-25 18:41 ` Michael Buesch
2008-01-25 21:11 ` Inaky Perez-Gonzalez
2008-01-25 21:21 ` Michael Buesch
2008-01-25 21:28 ` Inaky Perez-Gonzalez
2008-01-26 13:42 ` David Miller
2008-01-27 2:26 ` Luis R. Rodriguez
2008-01-29 19:07 ` Inaky Perez-Gonzalez
2008-01-25 21:46 ` John W. Linville
2008-01-25 22:15 ` Michael Buesch
2008-01-25 22:34 ` Tomas Winkler
2008-01-26 13:49 ` David Miller
2008-01-25 21:46 ` Guy Cohen
2008-01-25 21:54 ` Linus Torvalds
2008-01-26 13:46 ` David Miller
2008-01-25 18:34 ` John W. Linville
2008-01-24 22:17 ` Michael Buesch
2008-01-24 22:26 ` Linus Torvalds
2008-01-24 22:33 ` Michael Buesch
2008-01-08 0:50 ` J.A. Magallón
2008-01-09 1:32 ` Avuton Olrich
2008-01-09 1:56 ` Tejun Heo
2008-01-10 9:25 ` J.A. Magallón
2008-01-10 13:10 ` Tejun Heo
2008-01-13 23:19 ` J.A. Magallón
2008-01-13 23:57 ` Tejun Heo
2008-01-14 23:38 ` J.A. Magallón
2008-01-14 23:56 ` Tejun Heo
2008-01-08 18:42 ` Linux 2.6.24-rc7: sparc64: WARNING: at kernel/lockdep_proc.c:267 lockdep_stats_show() Mariusz Kozlowski
2008-01-08 18:42 ` Mariusz Kozlowski
2008-01-08 21:00 ` Linux 2.6.24-rc7: sparc64: WARNING: at Randy Dunlap
2008-01-08 21:00 ` Linux 2.6.24-rc7: sparc64: WARNING: at kernel/lockdep_proc.c:267 lockdep_stats_show() Randy Dunlap
2008-01-08 22:39 ` Mariusz Kozlowski
2008-01-08 22:39 ` Mariusz Kozlowski
2008-01-08 22:45 ` Linux 2.6.24-rc7: sparc64: WARNING: at kernel/lockdep_proc.c:267 Randy Dunlap
2008-01-08 22:45 ` Linux 2.6.24-rc7: sparc64: WARNING: at kernel/lockdep_proc.c:267 lockdep_stats_show() Randy Dunlap
2008-01-09 16:31 ` Mariusz Kozlowski
2008-01-09 16:31 ` Mariusz Kozlowski
2008-01-08 22:50 ` Linux 2.6.24-rc7: sparc64: WARNING: at David Miller
2008-01-08 22:50 ` Linux 2.6.24-rc7: sparc64: WARNING: at kernel/lockdep_proc.c:267 lockdep_stats_show() David Miller
2008-01-08 22:56 ` Linux 2.6.24-rc7: sparc64: WARNING: at Ingo Molnar
2008-01-08 22:56 ` Linux 2.6.24-rc7: sparc64: WARNING: at kernel/lockdep_proc.c:267 lockdep_stats_show() Ingo Molnar
2008-01-08 23:06 ` Linux 2.6.24-rc7: sparc64: WARNING: at David Miller
2008-01-08 23:06 ` Linux 2.6.24-rc7: sparc64: WARNING: at kernel/lockdep_proc.c:267 lockdep_stats_show() David Miller
2008-01-09 0:52 ` Linux 2.6.24-rc7: sparc64: WARNING: at Ingo Molnar
2008-01-09 0:52 ` Linux 2.6.24-rc7: sparc64: WARNING: at kernel/lockdep_proc.c:267 lockdep_stats_show() Ingo Molnar
2008-01-09 1:17 ` Linux 2.6.24-rc7 Willy Tarreau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080108133438.7d0b41f4@hyperion.delvare \
--to=khali@linux-fr.org \
--cc=airlied@linux.ie \
--cc=akpm@linux-foundation.org \
--cc=apw@shadowen.org \
--cc=balbir@linux.vnet.ibm.com \
--cc=bunk@kernel.org \
--cc=clameter@sgi.com \
--cc=kamalesh@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.