diff options
| author | Trilok Soni <tsoni@codeaurora.org> | 2016-08-25 19:05:37 -0700 |
|---|---|---|
| committer | Trilok Soni <tsoni@codeaurora.org> | 2016-08-26 14:34:05 -0700 |
| commit | 5ab1e18aa3913d454e1bd1498b20ee581aae2c6b (patch) | |
| tree | 42bd10ef0bf5cdb8deb05656bf802c77dc580ff7 /drivers/firmware/efi/vars.c | |
| parent | e97b6a0e0217f7c072fdad6c50673cd7a64348e1 (diff) | |
Revert "Merge remote-tracking branch 'msm-4.4/tmp-510d0a3f' into msm-4.4"
This reverts commit 9d6fd2c3e9fcfb ("Merge remote-tracking branch
'msm-4.4/tmp-510d0a3f' into msm-4.4"), because it breaks the
dump parsing tools due to kernel can be loaded anywhere in the memory
now and not fixed at linear mapping.
Change-Id: Id416f0a249d803442847d09ac47781147b0d0ee6
Signed-off-by: Trilok Soni <tsoni@codeaurora.org>
Diffstat (limited to 'drivers/firmware/efi/vars.c')
| -rw-r--r-- | drivers/firmware/efi/vars.c | 37 |
1 files changed, 11 insertions, 26 deletions
diff --git a/drivers/firmware/efi/vars.c b/drivers/firmware/efi/vars.c index 6f182fd91a6d..7f2ea21c730d 100644 --- a/drivers/firmware/efi/vars.c +++ b/drivers/firmware/efi/vars.c @@ -202,44 +202,29 @@ static const struct variable_validate variable_validate[] = { { NULL_GUID, "", NULL }, }; -/* - * Check if @var_name matches the pattern given in @match_name. - * - * @var_name: an array of @len non-NUL characters. - * @match_name: a NUL-terminated pattern string, optionally ending in "*". A - * final "*" character matches any trailing characters @var_name, - * including the case when there are none left in @var_name. - * @match: on output, the number of non-wildcard characters in @match_name - * that @var_name matches, regardless of the return value. - * @return: whether @var_name fully matches @match_name. - */ static bool variable_matches(const char *var_name, size_t len, const char *match_name, int *match) { for (*match = 0; ; (*match)++) { char c = match_name[*match]; + char u = var_name[*match]; - switch (c) { - case '*': - /* Wildcard in @match_name means we've matched. */ + /* Wildcard in the matching name means we've matched */ + if (c == '*') return true; - case '\0': - /* @match_name has ended. Has @var_name too? */ - return (*match == len); + /* Case sensitive match */ + if (!c && *match == len) + return true; - default: - /* - * We've reached a non-wildcard char in @match_name. - * Continue only if there's an identical character in - * @var_name. - */ - if (*match < len && c == var_name[*match]) - continue; + if (c != u) return false; - } + + if (!c) + return true; } + return true; } bool |
