diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /drivers/firmware/dmi_scan.c | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/firmware/dmi_scan.c')
-rw-r--r-- | drivers/firmware/dmi_scan.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c index 938100f14b16..d46467271349 100644 --- a/drivers/firmware/dmi_scan.c +++ b/drivers/firmware/dmi_scan.c | |||
@@ -5,7 +5,6 @@ | |||
5 | #include <linux/dmi.h> | 5 | #include <linux/dmi.h> |
6 | #include <linux/efi.h> | 6 | #include <linux/efi.h> |
7 | #include <linux/bootmem.h> | 7 | #include <linux/bootmem.h> |
8 | #include <linux/slab.h> | ||
9 | #include <asm/dmi.h> | 8 | #include <asm/dmi.h> |
10 | 9 | ||
11 | /* | 10 | /* |
@@ -169,10 +168,7 @@ static void __init dmi_save_uuid(const struct dmi_header *dm, int slot, int inde | |||
169 | if (!s) | 168 | if (!s) |
170 | return; | 169 | return; |
171 | 170 | ||
172 | sprintf(s, | 171 | sprintf(s, "%pUB", d); |
173 | "%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X", | ||
174 | d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7], | ||
175 | d[8], d[9], d[10], d[11], d[12], d[13], d[14], d[15]); | ||
176 | 172 | ||
177 | dmi_ident[slot] = s; | 173 | dmi_ident[slot] = s; |
178 | } | 174 | } |
@@ -429,7 +425,7 @@ static bool dmi_matches(const struct dmi_system_id *dmi) | |||
429 | for (i = 0; i < ARRAY_SIZE(dmi->matches); i++) { | 425 | for (i = 0; i < ARRAY_SIZE(dmi->matches); i++) { |
430 | int s = dmi->matches[i].slot; | 426 | int s = dmi->matches[i].slot; |
431 | if (s == DMI_NONE) | 427 | if (s == DMI_NONE) |
432 | continue; | 428 | break; |
433 | if (dmi_ident[s] | 429 | if (dmi_ident[s] |
434 | && strstr(dmi_ident[s], dmi->matches[i].substr)) | 430 | && strstr(dmi_ident[s], dmi->matches[i].substr)) |
435 | continue; | 431 | continue; |
@@ -440,6 +436,15 @@ static bool dmi_matches(const struct dmi_system_id *dmi) | |||
440 | } | 436 | } |
441 | 437 | ||
442 | /** | 438 | /** |
439 | * dmi_is_end_of_table - check for end-of-table marker | ||
440 | * @dmi: pointer to the dmi_system_id structure to check | ||
441 | */ | ||
442 | static bool dmi_is_end_of_table(const struct dmi_system_id *dmi) | ||
443 | { | ||
444 | return dmi->matches[0].slot == DMI_NONE; | ||
445 | } | ||
446 | |||
447 | /** | ||
443 | * dmi_check_system - check system DMI data | 448 | * dmi_check_system - check system DMI data |
444 | * @list: array of dmi_system_id structures to match against | 449 | * @list: array of dmi_system_id structures to match against |
445 | * All non-null elements of the list must match | 450 | * All non-null elements of the list must match |
@@ -457,7 +462,7 @@ int dmi_check_system(const struct dmi_system_id *list) | |||
457 | int count = 0; | 462 | int count = 0; |
458 | const struct dmi_system_id *d; | 463 | const struct dmi_system_id *d; |
459 | 464 | ||
460 | for (d = list; d->ident; d++) | 465 | for (d = list; !dmi_is_end_of_table(d); d++) |
461 | if (dmi_matches(d)) { | 466 | if (dmi_matches(d)) { |
462 | count++; | 467 | count++; |
463 | if (d->callback && d->callback(d)) | 468 | if (d->callback && d->callback(d)) |
@@ -484,7 +489,7 @@ const struct dmi_system_id *dmi_first_match(const struct dmi_system_id *list) | |||
484 | { | 489 | { |
485 | const struct dmi_system_id *d; | 490 | const struct dmi_system_id *d; |
486 | 491 | ||
487 | for (d = list; d->ident; d++) | 492 | for (d = list; !dmi_is_end_of_table(d); d++) |
488 | if (dmi_matches(d)) | 493 | if (dmi_matches(d)) |
489 | return d; | 494 | return d; |
490 | 495 | ||