mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
04f5bda84b
When building with W=1, warnings about missing prototypes are emitted: CC arch/x86/lib/cpu.o arch/x86/lib/cpu.c:5:14: warning: no previous prototype for 'x86_family' [-Wmissing-prototypes] 5 | unsigned int x86_family(unsigned int sig) | ^~~~~~~~~~ arch/x86/lib/cpu.c:18:14: warning: no previous prototype for 'x86_model' [-Wmissing-prototypes] 18 | unsigned int x86_model(unsigned int sig) | ^~~~~~~~~ arch/x86/lib/cpu.c:33:14: warning: no previous prototype for 'x86_stepping' [-Wmissing-prototypes] 33 | unsigned int x86_stepping(unsigned int sig) | ^~~~~~~~~~~~ Add the proper include file so the prototypes are there. Signed-off-by: Valdis Kletnieks <valdis.kletnieks@vt.edu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lkml.kernel.org/r/42513.1565234837@turing-police
39 lines
624 B
C
39 lines
624 B
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
#include <linux/types.h>
|
|
#include <linux/export.h>
|
|
#include <asm/cpu.h>
|
|
|
|
unsigned int x86_family(unsigned int sig)
|
|
{
|
|
unsigned int x86;
|
|
|
|
x86 = (sig >> 8) & 0xf;
|
|
|
|
if (x86 == 0xf)
|
|
x86 += (sig >> 20) & 0xff;
|
|
|
|
return x86;
|
|
}
|
|
EXPORT_SYMBOL_GPL(x86_family);
|
|
|
|
unsigned int x86_model(unsigned int sig)
|
|
{
|
|
unsigned int fam, model;
|
|
|
|
fam = x86_family(sig);
|
|
|
|
model = (sig >> 4) & 0xf;
|
|
|
|
if (fam >= 0x6)
|
|
model += ((sig >> 16) & 0xf) << 4;
|
|
|
|
return model;
|
|
}
|
|
EXPORT_SYMBOL_GPL(x86_model);
|
|
|
|
unsigned int x86_stepping(unsigned int sig)
|
|
{
|
|
return sig & 0xf;
|
|
}
|
|
EXPORT_SYMBOL_GPL(x86_stepping);
|