@@ -17,7 +17,7 @@ static void test_cmpxchg8b(u32 *mem)
report("cmpxchg8b", mem[0] == 3 && mem[1] == 4);
}
-int main()
+int main(void)
{
setup_vm();
setup_idt();
@@ -8,7 +8,7 @@ static int check_cpuid_80000001_edx(unsigned int bit)
}
#define CPUID_7_0_ECX_RDPID (1 << 22)
-int check_cpuid_7_0_ecx(unsigned int bit)
+static int check_cpuid_7_0_ecx(unsigned int bit)
{
return (cpuid_indexed(7, 0).c & bit) != 0;
}
@@ -31,7 +31,7 @@ static void test_rdtscp(u64 aux)
report("Test RDTSCP %" PRIu64, ecx == aux, aux);
}
-void test_rdpid(u64 aux)
+static void test_rdpid(u64 aux)
{
u32 eax;
@@ -13,7 +13,7 @@ static unsigned long expected_rip;
static int skip_count;
static volatile int gp_count;
-void gp_handler(struct ex_regs *regs)
+static void gp_handler(struct ex_regs *regs)
{
if (regs->rip == expected_rip) {
gp_count++;
@@ -116,7 +116,7 @@ static void test_umip_gp(const char *msg)
/* The ugly mode switching code */
-int do_ring3(void (*fn)(const char *), const char *arg)
+static int do_ring3(void (*fn)(const char *), const char *arg)
{
static unsigned char user_stack[4096];
int ret;
@@ -171,7 +171,7 @@ int do_ring3(void (*fn)(const char *), const char *arg)
return ret;
}
-int main()
+int main(void)
{
extern unsigned char kernel_entry;
@@ -335,7 +335,7 @@ static bool check_all_vmcs_fields(u8 cookie)
return pass;
}
-void test_vmwrite_vmread(void)
+static void test_vmwrite_vmread(void)
{
struct vmcs *vmcs = alloc_page();
@@ -351,7 +351,7 @@ void test_vmwrite_vmread(void)
free_page(vmcs);
}
-void test_vmcs_high(void)
+static void test_vmcs_high(void)
{
struct vmcs *vmcs = alloc_page();
@@ -375,7 +375,7 @@ void test_vmcs_high(void)
free_page(vmcs);
}
-void test_vmcs_lifecycle(void)
+static void test_vmcs_lifecycle(void)
{
struct vmcs *vmcs[2] = {};
int i;
This makes the code compilable with the compiler flags -Wstrict-prototypes and -Wmissing-prototypes. Signed-off-by: Thomas Huth <thuth@redhat.com> --- x86/cmpxchg8b.c | 2 +- x86/tsc.c | 4 ++-- x86/umip.c | 6 +++--- x86/vmx.c | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-)