diff options
author | Andrey Panin <pazke@donpac.ru> | 2005-09-06 18:18:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-07 19:57:44 -0400 |
commit | 61e032fa2f659fada02ede5087b46963a1c7de34 (patch) | |
tree | d31edaca05e90ac99f3c7bc98874e0c399049cba /arch/i386 | |
parent | e08fc0457af28f2ebec36296ea7ada6024fde81b (diff) |
[PATCH] dmi: remove uneeded function
After elimination of central DMI blacklist dmi_scan_machine() function became
a wrapper for dmi_iterate(). This patch moves some code around to kill
unneeded function.
Signed-off-by: Andrey Panin <pazke@donpac.ru>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/i386')
-rw-r--r-- | arch/i386/kernel/dmi_scan.c | 85 |
1 files changed, 40 insertions, 45 deletions
diff --git a/arch/i386/kernel/dmi_scan.c b/arch/i386/kernel/dmi_scan.c index a3cdf894302b..6ae4ef472dbf 100644 --- a/arch/i386/kernel/dmi_scan.c +++ b/arch/i386/kernel/dmi_scan.c | |||
@@ -84,49 +84,6 @@ static int __init dmi_checksum(u8 *buf) | |||
84 | return sum == 0; | 84 | return sum == 0; |
85 | } | 85 | } |
86 | 86 | ||
87 | static int __init dmi_iterate(void (*decode)(struct dmi_header *)) | ||
88 | { | ||
89 | u8 buf[15]; | ||
90 | char __iomem *p, *q; | ||
91 | |||
92 | /* | ||
93 | * no iounmap() for that ioremap(); it would be a no-op, but it's | ||
94 | * so early in setup that sucker gets confused into doing what | ||
95 | * it shouldn't if we actually call it. | ||
96 | */ | ||
97 | p = ioremap(0xF0000, 0x10000); | ||
98 | if (p == NULL) | ||
99 | return -1; | ||
100 | |||
101 | for (q = p; q < p + 0x10000; q += 16) { | ||
102 | memcpy_fromio(buf, q, 15); | ||
103 | if ((memcmp(buf, "_DMI_", 5) == 0) && dmi_checksum(buf)) { | ||
104 | u16 num = (buf[13] << 8) | buf[12]; | ||
105 | u16 len = (buf[7] << 8) | buf[6]; | ||
106 | u32 base = (buf[11] << 24) | (buf[10] << 16) | | ||
107 | (buf[9] << 8) | buf[8]; | ||
108 | |||
109 | /* | ||
110 | * DMI version 0.0 means that the real version is taken from | ||
111 | * the SMBIOS version, which we don't know at this point. | ||
112 | */ | ||
113 | if (buf[14] != 0) | ||
114 | printk(KERN_INFO "DMI %d.%d present.\n", | ||
115 | buf[14] >> 4, buf[14] & 0xF); | ||
116 | else | ||
117 | printk(KERN_INFO "DMI present.\n"); | ||
118 | |||
119 | dmi_printk((KERN_INFO "%d structures occupying %d bytes.\n", | ||
120 | num, len)); | ||
121 | dmi_printk((KERN_INFO "DMI table at 0x%08X.\n", base)); | ||
122 | |||
123 | if (dmi_table(base,len, num, decode) == 0) | ||
124 | return 0; | ||
125 | } | ||
126 | } | ||
127 | return -1; | ||
128 | } | ||
129 | |||
130 | static char *dmi_ident[DMI_STRING_MAX]; | 87 | static char *dmi_ident[DMI_STRING_MAX]; |
131 | 88 | ||
132 | /* | 89 | /* |
@@ -190,8 +147,46 @@ static void __init dmi_decode(struct dmi_header *dm) | |||
190 | 147 | ||
191 | void __init dmi_scan_machine(void) | 148 | void __init dmi_scan_machine(void) |
192 | { | 149 | { |
193 | if (dmi_iterate(dmi_decode)) | 150 | u8 buf[15]; |
194 | printk(KERN_INFO "DMI not present.\n"); | 151 | char __iomem *p, *q; |
152 | |||
153 | /* | ||
154 | * no iounmap() for that ioremap(); it would be a no-op, but it's | ||
155 | * so early in setup that sucker gets confused into doing what | ||
156 | * it shouldn't if we actually call it. | ||
157 | */ | ||
158 | p = ioremap(0xF0000, 0x10000); | ||
159 | if (p == NULL) | ||
160 | goto out; | ||
161 | |||
162 | for (q = p; q < p + 0x10000; q += 16) { | ||
163 | memcpy_fromio(buf, q, 15); | ||
164 | if ((memcmp(buf, "_DMI_", 5) == 0) && dmi_checksum(buf)) { | ||
165 | u16 num = (buf[13] << 8) | buf[12]; | ||
166 | u16 len = (buf[7] << 8) | buf[6]; | ||
167 | u32 base = (buf[11] << 24) | (buf[10] << 16) | | ||
168 | (buf[9] << 8) | buf[8]; | ||
169 | |||
170 | /* | ||
171 | * DMI version 0.0 means that the real version is taken from | ||
172 | * the SMBIOS version, which we don't know at this point. | ||
173 | */ | ||
174 | if (buf[14] != 0) | ||
175 | printk(KERN_INFO "DMI %d.%d present.\n", | ||
176 | buf[14] >> 4, buf[14] & 0xF); | ||
177 | else | ||
178 | printk(KERN_INFO "DMI present.\n"); | ||
179 | |||
180 | dmi_printk((KERN_INFO "%d structures occupying %d bytes.\n", | ||
181 | num, len)); | ||
182 | dmi_printk((KERN_INFO "DMI table at 0x%08X.\n", base)); | ||
183 | |||
184 | if (dmi_table(base,len, num, dmi_decode) == 0) | ||
185 | return; | ||
186 | } | ||
187 | } | ||
188 | |||
189 | out: printk(KERN_INFO "DMI not present.\n"); | ||
195 | } | 190 | } |
196 | 191 | ||
197 | 192 | ||