aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firmware/google/gsmi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/firmware/google/gsmi.c')
-rw-r--r--drivers/firmware/google/gsmi.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/firmware/google/gsmi.c b/drivers/firmware/google/gsmi.c
index 757b2d92d5b0..acba0b9f4406 100644
--- a/drivers/firmware/google/gsmi.c
+++ b/drivers/firmware/google/gsmi.c
@@ -28,6 +28,7 @@
28#include <linux/reboot.h> 28#include <linux/reboot.h>
29#include <linux/efi.h> 29#include <linux/efi.h>
30#include <linux/module.h> 30#include <linux/module.h>
31#include <linux/ucs2_string.h>
31 32
32#define GSMI_SHUTDOWN_CLEAN 0 /* Clean Shutdown */ 33#define GSMI_SHUTDOWN_CLEAN 0 /* Clean Shutdown */
33/* TODO(mikew@google.com): Tie in HARDLOCKUP_DETECTOR with NMIWDT */ 34/* TODO(mikew@google.com): Tie in HARDLOCKUP_DETECTOR with NMIWDT */
@@ -300,7 +301,7 @@ static efi_status_t gsmi_get_variable(efi_char16_t *name,
300 }; 301 };
301 efi_status_t ret = EFI_SUCCESS; 302 efi_status_t ret = EFI_SUCCESS;
302 unsigned long flags; 303 unsigned long flags;
303 size_t name_len = utf16_strnlen(name, GSMI_BUF_SIZE / 2); 304 size_t name_len = ucs2_strnlen(name, GSMI_BUF_SIZE / 2);
304 int rc; 305 int rc;
305 306
306 if (name_len >= GSMI_BUF_SIZE / 2) 307 if (name_len >= GSMI_BUF_SIZE / 2)
@@ -369,7 +370,7 @@ static efi_status_t gsmi_get_next_variable(unsigned long *name_size,
369 return EFI_BAD_BUFFER_SIZE; 370 return EFI_BAD_BUFFER_SIZE;
370 371
371 /* Let's make sure the thing is at least null-terminated */ 372 /* Let's make sure the thing is at least null-terminated */
372 if (utf16_strnlen(name, GSMI_BUF_SIZE / 2) == GSMI_BUF_SIZE / 2) 373 if (ucs2_strnlen(name, GSMI_BUF_SIZE / 2) == GSMI_BUF_SIZE / 2)
373 return EFI_INVALID_PARAMETER; 374 return EFI_INVALID_PARAMETER;
374 375
375 spin_lock_irqsave(&gsmi_dev.lock, flags); 376 spin_lock_irqsave(&gsmi_dev.lock, flags);
@@ -397,7 +398,7 @@ static efi_status_t gsmi_get_next_variable(unsigned long *name_size,
397 398
398 /* Copy the name back */ 399 /* Copy the name back */
399 memcpy(name, gsmi_dev.name_buf->start, GSMI_BUF_SIZE); 400 memcpy(name, gsmi_dev.name_buf->start, GSMI_BUF_SIZE);
400 *name_size = utf16_strnlen(name, GSMI_BUF_SIZE / 2) * 2; 401 *name_size = ucs2_strnlen(name, GSMI_BUF_SIZE / 2) * 2;
401 402
402 /* copy guid to return buffer */ 403 /* copy guid to return buffer */
403 memcpy(vendor, &param.guid, sizeof(param.guid)); 404 memcpy(vendor, &param.guid, sizeof(param.guid));
@@ -423,7 +424,7 @@ static efi_status_t gsmi_set_variable(efi_char16_t *name,
423 EFI_VARIABLE_BOOTSERVICE_ACCESS | 424 EFI_VARIABLE_BOOTSERVICE_ACCESS |
424 EFI_VARIABLE_RUNTIME_ACCESS, 425 EFI_VARIABLE_RUNTIME_ACCESS,
425 }; 426 };
426 size_t name_len = utf16_strnlen(name, GSMI_BUF_SIZE / 2); 427 size_t name_len = ucs2_strnlen(name, GSMI_BUF_SIZE / 2);
427 efi_status_t ret = EFI_SUCCESS; 428 efi_status_t ret = EFI_SUCCESS;
428 int rc; 429 int rc;
429 unsigned long flags; 430 unsigned long flags;