Re: [kvm-unit-tests PATCH 1/4] Make vmx_tests.c compilable with -Wmissing-prototypes and -Wstrict-prototypes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 27, 2018 at 10:02:05AM +0200, Thomas Huth wrote:
> -extern void insn_hlt();
> -extern void insn_invlpg();
> -extern void insn_mwait();
> -extern void insn_rdpmc();
> -extern void insn_rdtsc();
> -extern void insn_cr3_load();
> -extern void insn_cr3_store();
> +extern void insn_hlt(void);
> +extern void insn_invlpg(void);
> +extern void insn_mwait(void);
> +extern void insn_rdpmc(void);
> +extern void insn_rdtsc(void);
> +extern void insn_cr3_load(void);
> +extern void insn_cr3_store(void);
>  #ifdef __x86_64__
> -extern void insn_cr8_load();
> -extern void insn_cr8_store();
> +extern void insn_cr8_load(void);
> +extern void insn_cr8_store(void);
>  #endif
> -extern void insn_monitor();
> -extern void insn_pause();
> -extern void insn_wbinvd();
> -extern void insn_sgdt();
> -extern void insn_lgdt();
> -extern void insn_sidt();
> -extern void insn_lidt();
> -extern void insn_sldt();
> -extern void insn_lldt();
> -extern void insn_str();
> -extern void insn_cpuid();
> -extern void insn_invd();
> -extern void insn_rdrand();
> -extern void insn_rdseed();
> +extern void insn_monitor(void);
> +extern void insn_pause(void);
> +extern void insn_wbinvd(void);
> +extern void insn_sgdt(void);
> +extern void insn_lgdt(void);
> +extern void insn_sidt(void);
> +extern void insn_lidt(void);
> +extern void insn_sldt(void);
> +extern void insn_lldt(void);
> +extern void insn_str(void);
> +extern void insn_cpuid(void);
> +extern void insn_invd(void);
> +extern void insn_rdrand(void);
> +extern void insn_rdseed(void);
>

Another nice prototype cleanup would be to remove the
unnecessary use of 'extern' everywhere.  We have around
250 useless uses. You could get the majority of the x86
ones while you're touching them here.

s390x only has one and powerpc only 16. So they don't
require much churn. I have 85 in arm code. Churning
code just to drop the use is a bit lame, but continuing
to add more in order to maintain consistency is also
getting pretty lame. And then there around 100 or so
in lib, but a decent amount of those could get changed
while doing another cleanup on the TODO list, which is
to do away with libcflat.h in favor of individual includes.

Thanks,
drew



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux