crc32: Use the crc.h header for crc functions
[platform/kernel/u-boot.git] / lib / efi_selftest / efi_selftest_config_table.c
index 2aa3fc7..2bf12b5 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <efi_selftest.h>
+#include <u-boot/crc.h>
 
 static const struct efi_system_table *sys_table;
 static struct efi_boot_services *boottime;
@@ -18,7 +19,7 @@ static efi_guid_t table_guid =
                 0x17, 0x2e, 0x51, 0x6b, 0x49, 0x75);
 
 /*
- * Notification function, increments the notfication count if parameter
+ * Notification function, increments the notification count if parameter
  * context is provided.
  *
  * @event      notified event
@@ -33,23 +34,23 @@ static void EFIAPI notify(struct efi_event *event, void *context)
 }
 
 /*
- * Check crc32 of a table.
+ * Check CRC32 of a table.
  */
 static int check_table(const void *table)
 {
        efi_status_t ret;
        u32 crc32, res;
-       /* Casting from const to not const */
+       /* Casting from constant to not constant */
        struct efi_table_hdr *hdr = (struct efi_table_hdr *)table;
 
        crc32 = hdr->crc32;
        /*
-        * Setting the crc32 of the 'const' table to zero is easier than
+        * Setting the CRC32 of the 'const' table to zero is easier than
         * copying
         */
        hdr->crc32 = 0;
        ret = boottime->calculate_crc32(table, hdr->headersize, &res);
-       /* Reset table crc32 so it stays constant */
+       /* Reset table CRC32 so it stays constant */
        hdr->crc32 = crc32;
        if (ret != EFI_ST_SUCCESS) {
                efi_st_error("CalculateCrc32 failed\n");
@@ -153,8 +154,8 @@ static int execute(void)
        }
        table = NULL;
        for (i = 0; i < sys_table->nr_tables; ++i) {
-               if (!efi_st_memcmp(&sys_table->tables[i].guid, &table_guid,
-                                  sizeof(efi_guid_t)))
+               if (!memcmp(&sys_table->tables[i].guid, &table_guid,
+                           sizeof(efi_guid_t)))
                        table = sys_table->tables[i].table;
        }
        if (!table) {
@@ -192,8 +193,8 @@ static int execute(void)
        table = NULL;
        tabcnt = 0;
        for (i = 0; i < sys_table->nr_tables; ++i) {
-               if (!efi_st_memcmp(&sys_table->tables[i].guid, &table_guid,
-                                  sizeof(efi_guid_t))) {
+               if (!memcmp(&sys_table->tables[i].guid, &table_guid,
+                           sizeof(efi_guid_t))) {
                        table = sys_table->tables[i].table;
                        ++tabcnt;
                }
@@ -203,7 +204,7 @@ static int execute(void)
                return EFI_ST_FAILURE;
        }
        if (tabcnt > 1) {
-               efi_st_error("Duplicate table guid\n");
+               efi_st_error("Duplicate table GUID\n");
                return EFI_ST_FAILURE;
        }
        if (table != &tables[1]) {
@@ -235,8 +236,8 @@ static int execute(void)
        }
        table = NULL;
        for (i = 0; i < sys_table->nr_tables; ++i) {
-               if (!efi_st_memcmp(&sys_table->tables[i].guid, &table_guid,
-                                  sizeof(efi_guid_t))) {
+               if (!memcmp(&sys_table->tables[i].guid, &table_guid,
+                           sizeof(efi_guid_t))) {
                        table = sys_table->tables[i].table;
                }
        }