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>

authored by Jean Delvare and committed by Linus Torvalds ce8c628a 83a08e7c

+14 -5
+14 -5
drivers/firmware/dmi-id.c
··· 175 175 176 176 extern int dmi_available; 177 177 178 - static 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! */ 180 + static void __init dmi_id_init_attr_table(void) 179 181 { 180 - int ret, i; 181 - 182 - if (!dmi_available) 183 - return -ENODEV; 182 + int i; 184 183 185 184 /* Not necessarily all DMI fields are available on all 186 185 * systems, hence let's built an attribute table of just ··· 204 205 ADD_DMI_ATTR(chassis_serial, DMI_CHASSIS_SERIAL); 205 206 ADD_DMI_ATTR(chassis_asset_tag, DMI_CHASSIS_ASSET_TAG); 206 207 sys_dmi_attributes[i++] = &sys_dmi_modalias_attr.attr; 208 + } 209 + 210 + static int __init dmi_id_init(void) 211 + { 212 + int ret; 213 + 214 + if (!dmi_available) 215 + return -ENODEV; 216 + 217 + dmi_id_init_attr_table(); 207 218 208 219 ret = class_register(&dmi_class); 209 220 if (ret)