@@ -354,7 +354,7 @@ static inline void sti(void)
asm volatile ("sti");
}
-static inline unsigned long long rdtsc()
+static inline unsigned long long rdtsc(void)
{
long long r;
@@ -19,7 +19,7 @@ static volatile bool ipi_wait;
static int _cpu_count;
static atomic_t active_cpus;
-static __attribute__((used)) void ipi()
+static __attribute__((used)) void ipi(void)
{
void (*function)(void *data) = ipi_function;
void *data = ipi_data;
@@ -5,7 +5,7 @@
#include "asm/page.h"
#include "asm/io.h"
-void setup_5level_page_table();
+void setup_5level_page_table(void);
struct pte_search {
int level;
@@ -992,7 +992,7 @@ int ac_test_run(void)
return successes == tests;
}
-int main()
+int main(void)
{
int r;
@@ -518,7 +518,7 @@ static inline void apic_change_mode(unsigned long new_mode)
apic_write(APIC_LVTT, (lvtt & ~APIC_LVT_TIMER_MASK) | new_mode);
}
-static void test_apic_change_mode()
+static void test_apic_change_mode(void)
{
uint32_t tmict = 0x999999;
@@ -570,7 +570,7 @@ static void test_apic_change_mode()
report("TMCCT should stay at zero", !apic_read(APIC_TMCCT));
}
-int main()
+int main(void)
{
setup_vm();
smp_init();
@@ -33,7 +33,7 @@ struct insn_desc {
static char st1[] = "abcdefghijklmnop";
-void test_stringio()
+static void test_stringio(void)
{
unsigned char r = 0;
asm volatile("cld \n\t"
@@ -1015,7 +1015,7 @@ static void record_no_fep(struct ex_regs *regs)
regs->rip += KVM_FEP_LENGTH;
}
-int main()
+int main(void)
{
void *mem;
void *insn_page;
@@ -37,7 +37,7 @@ void apic_self_nmi(void)
extern char isr_iret_ip[];
-static void flush_idt_page()
+static void flush_idt_page(void)
{
struct descriptor_table_ptr ptr;
sidt(&ptr);
@@ -196,7 +196,7 @@ ulong saved_stack;
asm volatile ("mov %0, %%" R "sp"::"r"(saved_stack)); \
} while(0)
-int main()
+int main(void)
{
unsigned int res;
ulong *pt, *cr3, i;
@@ -160,7 +160,7 @@ bool pvclock_read_retry(const struct pvclock_vcpu_time_info *src,
return version != src->version;
}
-static inline u64 rdtsc_ordered()
+static inline u64 rdtsc_ordered(void)
{
/*
* FIXME: on Intel CPUs rmb() aka lfence is sufficient which brings up
@@ -36,7 +36,7 @@ struct timespec {
};
void pvclock_set_flags(unsigned char flags);
-cycle_t kvm_clock_read();
+cycle_t kvm_clock_read(void);
void kvm_get_wallclock(struct timespec *ts);
void kvm_clock_init(void *data);
void kvm_clock_clear(void *data);
@@ -49,7 +49,7 @@ asm ("pf_tss: \n\t"
"jmp pf_tss\n\t"
);
-static void init_test()
+static void init_test(void)
{
pf_count = 0;
@@ -95,7 +95,7 @@ static int num_counters;
char *buf;
-static inline void loop()
+static inline void loop(void)
{
unsigned long tmp, tmp2, tmp3;
@@ -1,6 +1,6 @@
#include "libcflat.h"
-int main()
+int main(void)
{
int i;
@@ -1,7 +1,7 @@
#include "libcflat.h"
#include "setjmp.h"
-int main()
+int main(void)
{
volatile int i;
jmp_buf j;
@@ -32,7 +32,7 @@ void test_sieve(const char *msg, char *data, int size)
#define VSIZE 100000000
char static_data[STATIC_SIZE];
-int main()
+int main(void)
{
void *v;
int i;
@@ -14,7 +14,7 @@ static void ipi_test(void *data)
nipis++;
}
-int main()
+int main(void)
{
int ncpus;
int i;
@@ -7,7 +7,7 @@
static void test_syscall_lazy_load(void)
{
- extern void syscall_target();
+ extern void syscall_target(void);
u16 cs = read_cs(), ss = read_ss();
ulong tmp;
@@ -57,8 +57,8 @@ asm(" .code32\n"
static void test_syscall_tf(void)
{
- extern void syscall32_target();
- extern void syscall_tf_user32();
+ extern void syscall32_target(void);
+ extern void syscall_tf_user32(void);
ulong rcx;
wrmsr(MSR_EFER, rdmsr(MSR_EFER) | EFER_SCE);
@@ -26,7 +26,7 @@ void test_rdtscp(u64 aux)
report("Test RDTSCP %" PRIu64, ecx == aux, aux);
}
-int main()
+int main(void)
{
u64 t1, t2;
@@ -1,7 +1,7 @@
#include "libcflat.h"
#include "processor.h"
-int main()
+int main(void)
{
u64 t1, t2, t3, t4, t5;
u64 est_delta_time;
@@ -1453,7 +1453,7 @@ static void __attribute__((__used__)) hypercall(u32 hypercall_no)
asm volatile("vmcall\n\t");
}
-static bool is_hypercall()
+static bool is_hypercall(void)
{
ulong reason, hyper_bit;
@@ -1464,7 +1464,7 @@ static bool is_hypercall()
return false;
}
-static int handle_hypercall()
+static int handle_hypercall(void)
{
ulong hypercall_no;
@@ -1518,7 +1518,7 @@ void test_skip(const char *msg)
abort();
}
-static int exit_handler()
+static int exit_handler(void)
{
int ret;
@@ -1590,7 +1590,7 @@ static bool vmx_enter_guest(struct vmentry_failure *failure)
return !failure->early && !(vmcs_read(EXI_REASON) & VMX_ENTRY_FAILURE);
}
-static int vmx_run()
+static int vmx_run(void)
{
while (1) {
u32 ret;
@@ -53,8 +53,8 @@ struct vmentry_failure {
struct vmx_test {
const char *name;
int (*init)(struct vmcs *vmcs);
- void (*guest_main)();
- int (*exit_handler)();
+ void (*guest_main)(void);
+ int (*exit_handler)(void);
void (*syscall_handler)(u64 syscall_no);
struct regs guest_regs;
int (*entry_failure_handler)(struct vmentry_failure *failure);
@@ -721,7 +721,7 @@ static inline bool invvpid(unsigned long type, u64 vpid, u64 gla)
}
const char *exit_reason_description(u64 reason);
-void print_vmexit_info();
+void print_vmexit_info(void);
void print_vmentry_failure_info(struct vmentry_failure *failure);
void ept_sync(int type, u64 eptp);
void vpid_sync(int type, u16 vpid);
This way the functions can not be called anymore with arbitrary parameters by accident. Signed-off-by: Thomas Huth <thuth@redhat.com> --- lib/x86/processor.h | 2 +- lib/x86/smp.c | 2 +- lib/x86/vm.h | 2 +- x86/access.c | 2 +- x86/apic.c | 4 ++-- x86/emulator.c | 4 ++-- x86/eventinj.c | 4 ++-- x86/kvmclock.c | 2 +- x86/kvmclock.h | 2 +- x86/pku.c | 2 +- x86/pmu.c | 2 +- x86/port80.c | 2 +- x86/setjmp.c | 2 +- x86/sieve.c | 2 +- x86/smptest.c | 2 +- x86/syscall.c | 6 +++--- x86/tsc.c | 2 +- x86/tsc_adjust.c | 2 +- x86/vmx.c | 8 ++++---- x86/vmx.h | 6 +++--- 20 files changed, 30 insertions(+), 30 deletions(-)