aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBorislav Petkov <borislav.petkov@amd.com>2012-07-20 08:12:21 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2012-08-22 19:15:26 -0400
commite7e632f5ba240fbc313c49ed6559681ea57534e9 (patch)
tree90ba39cc1717c9348f287224b09ac09b27aae9b8
parente43f6e67ec1c142550860bbe0b51166c5ee4cac8 (diff)
x86, microcode, AMD: Remove useless get_ucode_data wrapper
get_ucode_data was a trivial memcpy wrapper. Remove it so as not to obfuscate code unnecessarily with no obvious gain. No functional change. Signed-off-by: Borislav Petkov <borislav.petkov@amd.com> Link: http://lkml.kernel.org/r/1344361461-10076-7-git-send-email-bp@amd64.org Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r--arch/x86/include/asm/microcode.h6
-rw-r--r--arch/x86/kernel/microcode_amd.c4
2 files changed, 2 insertions, 8 deletions
diff --git a/arch/x86/include/asm/microcode.h b/arch/x86/include/asm/microcode.h
index 4ebe157bf73..8813be60099 100644
--- a/arch/x86/include/asm/microcode.h
+++ b/arch/x86/include/asm/microcode.h
@@ -49,12 +49,6 @@ static inline struct microcode_ops * __init init_intel_microcode(void)
49#ifdef CONFIG_MICROCODE_AMD 49#ifdef CONFIG_MICROCODE_AMD
50extern struct microcode_ops * __init init_amd_microcode(void); 50extern struct microcode_ops * __init init_amd_microcode(void);
51extern void __exit exit_amd_microcode(void); 51extern void __exit exit_amd_microcode(void);
52
53static inline void get_ucode_data(void *to, const u8 *from, size_t n)
54{
55 memcpy(to, from, n);
56}
57
58#else 52#else
59static inline struct microcode_ops * __init init_amd_microcode(void) 53static inline struct microcode_ops * __init init_amd_microcode(void)
60{ 54{
diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c
index 82746f942cd..94213387a3d 100644
--- a/arch/x86/kernel/microcode_amd.c
+++ b/arch/x86/kernel/microcode_amd.c
@@ -183,7 +183,7 @@ static int get_matching_microcode(int cpu, const u8 *ucode_ptr,
183 memset(patch, 0, PAGE_SIZE); 183 memset(patch, 0, PAGE_SIZE);
184 184
185 /* all looks ok, get the binary patch */ 185 /* all looks ok, get the binary patch */
186 get_ucode_data(patch, ucode_ptr + SECTION_HDR_SIZE, actual_size); 186 memcpy(patch, ucode_ptr + SECTION_HDR_SIZE, actual_size);
187 187
188 return actual_size; 188 return actual_size;
189} 189}
@@ -238,7 +238,7 @@ static int install_equiv_cpu_table(const u8 *buf)
238 return -ENOMEM; 238 return -ENOMEM;
239 } 239 }
240 240
241 get_ucode_data(equiv_cpu_table, buf + CONTAINER_HDR_SZ, size); 241 memcpy(equiv_cpu_table, buf + CONTAINER_HDR_SZ, size);
242 242
243 /* add header length */ 243 /* add header length */
244 return size + CONTAINER_HDR_SZ; 244 return size + CONTAINER_HDR_SZ;