Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 123496
b: refs/heads/master
c: d61c72e
h: refs/heads/master
v: v3
  • Loading branch information
Jiri Slaby authored and Jeff Garzik committed Dec 29, 2008
1 parent 13cebcb commit bcec4fd
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5ccfca974f3ce3c33be72f1fcb2b42747714ec79
refs/heads/master: d61c72e52b98411d1cfef1fdb3f5a8bb070f8966
16 changes: 16 additions & 0 deletions trunk/drivers/firmware/dmi_scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -582,3 +582,19 @@ int dmi_walk(void (*decode)(const struct dmi_header *))
return 0;
}
EXPORT_SYMBOL_GPL(dmi_walk);

/**
* dmi_match - compare a string to the dmi field (if exists)
*
* Returns true if the requested field equals to the str (including NULL).
*/
bool dmi_match(enum dmi_field f, const char *str)
{
const char *info = dmi_get_system_info(f);

if (info == NULL || str == NULL)
return info == str;

return !strcmp(info, str);
}
EXPORT_SYMBOL_GPL(dmi_match);
3 changes: 3 additions & 0 deletions trunk/include/linux/dmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ extern int dmi_name_in_vendors(const char *str);
extern int dmi_name_in_serial(const char *str);
extern int dmi_available;
extern int dmi_walk(void (*decode)(const struct dmi_header *));
extern bool dmi_match(enum dmi_field f, const char *str);

#else

Expand All @@ -61,6 +62,8 @@ static inline int dmi_name_in_serial(const char *s) { return 0; }
#define dmi_available 0
static inline int dmi_walk(void (*decode)(const struct dmi_header *))
{ return -1; }
static inline bool dmi_match(enum dmi_field f, const char *str)
{ return false; }

#endif

Expand Down

0 comments on commit bcec4fd

Please sign in to comment.