aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2008-01-08 18:33:08 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-01-08 19:10:36 -0500
commitce8c628abadaf16a44953301c68b9f54cf6898cc (patch)
tree2b5f560365aa156e984da78be6dc51a0aaac2547
parent83a08e7c6ed533a47631794e7f618a98094b4129 (diff)
dmi-id: fix for __you_cannot_kmalloc_that_much failure
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. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Dave Airlie <airlied@linux.ie> Tested-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/firmware/dmi-id.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/firmware/dmi-id.c b/drivers/firmware/dmi-id.c
index b6e1eb77d148..bc132d8f79cb 100644
--- a/drivers/firmware/dmi-id.c
+++ b/drivers/firmware/dmi-id.c
@@ -175,12 +175,11 @@ static struct device *dmi_dev;
175 175
176extern int dmi_available; 176extern int dmi_available;
177 177
178static int __init dmi_id_init(void) 178/* In a separate function to keep gcc 3.2 happy - do NOT merge this in
179 dmi_id_init! */
180static void __init dmi_id_init_attr_table(void)
179{ 181{
180 int ret, i; 182 int i;
181
182 if (!dmi_available)
183 return -ENODEV;
184 183
185 /* Not necessarily all DMI fields are available on all 184 /* Not necessarily all DMI fields are available on all
186 * systems, hence let's built an attribute table of just 185 * systems, hence let's built an attribute table of just
@@ -205,6 +204,16 @@ static int __init dmi_id_init(void)
205 ADD_DMI_ATTR(chassis_serial, DMI_CHASSIS_SERIAL); 204 ADD_DMI_ATTR(chassis_serial, DMI_CHASSIS_SERIAL);
206 ADD_DMI_ATTR(chassis_asset_tag, DMI_CHASSIS_ASSET_TAG); 205 ADD_DMI_ATTR(chassis_asset_tag, DMI_CHASSIS_ASSET_TAG);
207 sys_dmi_attributes[i++] = &sys_dmi_modalias_attr.attr; 206 sys_dmi_attributes[i++] = &sys_dmi_modalias_attr.attr;
207}
208
209static int __init dmi_id_init(void)
210{
211 int ret;
212
213 if (!dmi_available)
214 return -ENODEV;
215
216 dmi_id_init_attr_table();
208 217
209 ret = class_register(&dmi_class); 218 ret = class_register(&dmi_class);
210 if (ret) 219 if (ret)