diff options
Diffstat (limited to 'drivers/firmware/efivars.c')
-rw-r--r-- | drivers/firmware/efivars.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c index 4202a3170467..15b9a01b6c68 100644 --- a/drivers/firmware/efivars.c +++ b/drivers/firmware/efivars.c | |||
@@ -169,6 +169,24 @@ utf16_strsize(efi_char16_t *data, unsigned long maxlength) | |||
169 | return utf16_strnlen(data, maxlength/sizeof(efi_char16_t)) * sizeof(efi_char16_t); | 169 | return utf16_strnlen(data, maxlength/sizeof(efi_char16_t)) * sizeof(efi_char16_t); |
170 | } | 170 | } |
171 | 171 | ||
172 | static inline int | ||
173 | utf16_strncmp(const efi_char16_t *a, const efi_char16_t *b, size_t len) | ||
174 | { | ||
175 | while (1) { | ||
176 | if (len == 0) | ||
177 | return 0; | ||
178 | if (*a < *b) | ||
179 | return -1; | ||
180 | if (*a > *b) | ||
181 | return 1; | ||
182 | if (*a == 0) /* implies *b == 0 */ | ||
183 | return 0; | ||
184 | a++; | ||
185 | b++; | ||
186 | len--; | ||
187 | } | ||
188 | } | ||
189 | |||
172 | static efi_status_t | 190 | static efi_status_t |
173 | get_var_data_locked(struct efivars *efivars, struct efi_variable *var) | 191 | get_var_data_locked(struct efivars *efivars, struct efi_variable *var) |
174 | { | 192 | { |