Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 174260
b: refs/heads/master
c: 7575750
h: refs/heads/master
v: v3
  • Loading branch information
Dmitry Torokhov committed Dec 5, 2009
1 parent e0a8241 commit 505531c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7705d548cbe33f18ea7713b9a07aa11047aaeca4
refs/heads/master: 75757507e014fa074d25d2883c4ab604999584bd
15 changes: 12 additions & 3 deletions trunk/drivers/firmware/dmi_scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ static bool dmi_matches(const struct dmi_system_id *dmi)
for (i = 0; i < ARRAY_SIZE(dmi->matches); i++) {
int s = dmi->matches[i].slot;
if (s == DMI_NONE)
continue;
break;
if (dmi_ident[s]
&& strstr(dmi_ident[s], dmi->matches[i].substr))
continue;
Expand All @@ -439,6 +439,15 @@ static bool dmi_matches(const struct dmi_system_id *dmi)
return true;
}

/**
* dmi_is_end_of_table - check for end-of-table marker
* @dmi: pointer to the dmi_system_id structure to check
*/
static bool dmi_is_end_of_table(const struct dmi_system_id *dmi)
{
return dmi->matches[0].slot == DMI_NONE;
}

/**
* dmi_check_system - check system DMI data
* @list: array of dmi_system_id structures to match against
Expand All @@ -457,7 +466,7 @@ int dmi_check_system(const struct dmi_system_id *list)
int count = 0;
const struct dmi_system_id *d;

for (d = list; d->ident; d++)
for (d = list; !dmi_is_end_of_table(d); d++)
if (dmi_matches(d)) {
count++;
if (d->callback && d->callback(d))
Expand All @@ -484,7 +493,7 @@ const struct dmi_system_id *dmi_first_match(const struct dmi_system_id *list)
{
const struct dmi_system_id *d;

for (d = list; d->ident; d++)
for (d = list; !dmi_is_end_of_table(d); d++)
if (dmi_matches(d))
return d;

Expand Down

0 comments on commit 505531c

Please sign in to comment.