x86, microcode, AMD: Remove useless get_ucode_data wrapper
[linux-2.6-block.git] / arch / x86 / kernel / microcode_amd.c
index 8a2ce8fd41c0e68bbedc6fce685fb52c95502d24..94213387a3d1c7dfbddbdcd1770ec7c77dba693a 100644 (file)
@@ -143,11 +143,12 @@ static int get_matching_microcode(int cpu, const u8 *ucode_ptr,
                                  unsigned int *current_size)
 {
        struct microcode_header_amd *mc_hdr;
-       unsigned int actual_size;
+       unsigned int actual_size, patch_size;
        u16 equiv_cpu_id;
 
        /* size of the current patch we're staring at */
-       *current_size = *(u32 *)(ucode_ptr + 4) + SECTION_HDR_SIZE;
+       patch_size = *(u32 *)(ucode_ptr + 4);
+       *current_size = patch_size + SECTION_HDR_SIZE;
 
        equiv_cpu_id = find_equiv_id();
        if (!equiv_cpu_id)
@@ -174,7 +175,7 @@ static int get_matching_microcode(int cpu, const u8 *ucode_ptr,
        /*
         * now that the header looks sane, verify its size
         */
-       actual_size = verify_ucode_size(cpu, *current_size, leftover_size);
+       actual_size = verify_ucode_size(cpu, patch_size, leftover_size);
        if (!actual_size)
                return 0;
 
@@ -182,7 +183,7 @@ static int get_matching_microcode(int cpu, const u8 *ucode_ptr,
        memset(patch, 0, PAGE_SIZE);
 
        /* all looks ok, get the binary patch */
-       get_ucode_data(patch, ucode_ptr + SECTION_HDR_SIZE, actual_size);
+       memcpy(patch, ucode_ptr + SECTION_HDR_SIZE, actual_size);
 
        return actual_size;
 }
@@ -237,7 +238,7 @@ static int install_equiv_cpu_table(const u8 *buf)
                return -ENOMEM;
        }
 
-       get_ucode_data(equiv_cpu_table, buf + CONTAINER_HDR_SZ, size);
+       memcpy(equiv_cpu_table, buf + CONTAINER_HDR_SZ, size);
 
        /* add header length */
        return size + CONTAINER_HDR_SZ;