Message ID | 1476424893-7292-3-git-send-email-stewart@linux.vnet.ibm.com |
---|---|
State | Accepted |
Headers | show |
diff --git a/core/nvram-format.c b/core/nvram-format.c index b98aee1430ff..b110d804ffb7 100644 --- a/core/nvram-format.c +++ b/core/nvram-format.c @@ -262,3 +262,14 @@ const char *nvram_query(const char *key) return NULL; } + + +bool nvram_query_eq(const char *key, const char *value) +{ + const char *s = nvram_query(key); + + if (!s) + return false; + + return !strcmp(s, value); +} diff --git a/include/nvram.h b/include/nvram.h index d87561d79397..288b536827b5 100644 --- a/include/nvram.h +++ b/include/nvram.h @@ -23,5 +23,6 @@ void nvram_reinit(void); bool nvram_validate(void); const char *nvram_query(const char *name); +bool nvram_query_eq(const char *key, const char *value); #endif /* __NVRAM_H */