]> xenbits.xensource.com Git - people/sstabellini/xen-unstable.git/.git/commitdiff
x86/ucode/amd: Don't use void * for microcode_patch->mpb
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 27 Mar 2020 12:48:08 +0000 (12:48 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 1 Apr 2020 13:00:12 +0000 (14:00 +0100)
All code works fine with it having its correct type, and it even allows us to
drop two casts in a printk().

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/cpu/microcode/amd.c

index fd1804164249b05f12a9ee9c93a9cb0b4ba9f62f..575f87b487962887e52436781db5788fc55ebcb5 100644 (file)
@@ -59,7 +59,7 @@ struct __packed microcode_header_amd {
 #define UCODE_UCODE_TYPE           0x00000001
 
 struct microcode_patch {
-    void *mpb;
+    struct microcode_header_amd *mpb;
     size_t mpb_size;
     struct equiv_cpu_entry *equiv_cpu_table;
     size_t equiv_cpu_table_size;
@@ -330,8 +330,7 @@ static int get_ucode_from_buffer_amd(
 
     pr_debug("microcode: CPU%d size %zu, block size %u offset %zu equivID %#x rev %#x\n",
              smp_processor_id(), bufsize, mpbuf->len, *offset,
-             ((struct microcode_header_amd *)mc_amd->mpb)->processor_rev_id,
-             ((struct microcode_header_amd *)mc_amd->mpb)->patch_id);
+             mc_amd->mpb->processor_rev_id, mc_amd->mpb->patch_id);
 
     *offset += mpbuf->len + SECTION_HDR_SIZE;