Skip to content

Commit 0c5fa82

Browse files
suryasaimadhuIngo Molnar
authored andcommitted
x86/microcode/intel: Unexport save_mc_for_early()
It is used only in intel.c, drop the CONFIG_HOTPLUG_CPU ifdeffery from the header and turn it into a void function because its return value wasn't being used anyway. No functionality change. Signed-off-by: Borislav Petkov <bp@suse.de> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/1465225850-7352-8-git-send-email-bp@alien8.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 9198251 commit 0c5fa82

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

arch/x86/include/asm/microcode_intel.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,4 @@ static inline int __init save_microcode_in_initrd_intel(void) { return -EINVAL;
7070
static inline void reload_ucode_intel(void) {}
7171
#endif
7272

73-
#ifdef CONFIG_HOTPLUG_CPU
74-
extern int save_mc_for_early(u8 *mc);
75-
#else
76-
static inline int save_mc_for_early(u8 *mc) { return 0; }
77-
#endif
7873
#endif /* _ASM_X86_MICROCODE_INTEL_H */

arch/x86/kernel/cpu/microcode/intel.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -456,23 +456,23 @@ static void show_saved_mc(void)
456456
#endif
457457
}
458458

459-
#ifdef CONFIG_HOTPLUG_CPU
460-
static DEFINE_MUTEX(x86_cpu_microcode_mutex);
461459
/*
462460
* Save this mc into mc_saved_data. So it will be loaded early when a CPU is
463461
* hot added or resumes.
464462
*
465463
* Please make sure this mc should be a valid microcode patch before calling
466464
* this function.
467465
*/
468-
int save_mc_for_early(u8 *mc)
466+
static void save_mc_for_early(u8 *mc)
469467
{
468+
#ifdef CONFIG_HOTPLUG_CPU
469+
static DEFINE_MUTEX(x86_cpu_microcode_mutex);
470+
470471
struct microcode_intel *mc_saved_tmp[MAX_UCODE_COUNT];
471472
unsigned int mc_saved_count_init;
472473
unsigned int num_saved;
473474
struct microcode_intel **mc_saved;
474-
int ret = 0;
475-
int i;
475+
int ret, i;
476476

477477
/*
478478
* Hold hotplug lock so mc_saved_data is not accessed by a CPU in
@@ -515,11 +515,8 @@ int save_mc_for_early(u8 *mc)
515515

516516
out:
517517
mutex_unlock(&x86_cpu_microcode_mutex);
518-
519-
return ret;
520-
}
521-
EXPORT_SYMBOL_GPL(save_mc_for_early);
522518
#endif
519+
}
523520

524521
static bool __init load_builtin_intel_microcode(struct cpio_data *cp)
525522
{

0 commit comments

Comments
 (0)