Re: [kvm-unit-tests PATCH] lib/alloc: Fix/check the prototypes in the allocator files

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

 



On 03/04/2018 10:10, Thomas Huth wrote:
> We should make sure that the prototypes match the implementations and
> thus include the alloc_page.h header from alloc_page.c, and the
> alloc_phys.h header from alloc_phys.c. This way the file can be
> compiled with -Wmissing-prototypes and -Wstrict-prototypes, too.
> 
> Signed-off-by: Thomas Huth <thuth@xxxxxxxxxx>
> ---
>  lib/alloc_page.c | 1 +
>  lib/alloc_page.h | 2 +-
>  lib/alloc_phys.c | 1 +
>  lib/vmalloc.h    | 2 +-
>  4 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/alloc_page.c b/lib/alloc_page.c
> index 361b584..730f2b5 100644
> --- a/lib/alloc_page.c
> +++ b/lib/alloc_page.c
> @@ -7,6 +7,7 @@
>  #include "libcflat.h"
>  #include "alloc.h"
>  #include "alloc_phys.h"
> +#include "alloc_page.h"
>  #include "bitops.h"
>  #include <asm/page.h>
>  #include <asm/io.h>
> diff --git a/lib/alloc_page.h b/lib/alloc_page.h
> index 51d4841..5cdfec5 100644
> --- a/lib/alloc_page.h
> +++ b/lib/alloc_page.h
> @@ -10,7 +10,7 @@
>  
>  bool page_alloc_initialized(void);
>  void page_alloc_ops_enable(void);
> -void *alloc_page();
> +void *alloc_page(void);
>  void *alloc_pages(unsigned long order);
>  void free_page(void *page);
>  void free_pages(void *mem, unsigned long size);
> diff --git a/lib/alloc_phys.c b/lib/alloc_phys.c
> index 736c312..72e20f7 100644
> --- a/lib/alloc_phys.c
> +++ b/lib/alloc_phys.c
> @@ -9,6 +9,7 @@
>  #include "alloc.h"
>  #include "asm/spinlock.h"
>  #include "asm/io.h"
> +#include "alloc_phys.h"
>  
>  #define PHYS_ALLOC_NR_REGIONS	256
>  
> diff --git a/lib/vmalloc.h b/lib/vmalloc.h
> index b4cde65..3658b80 100644
> --- a/lib/vmalloc.h
> +++ b/lib/vmalloc.h
> @@ -6,7 +6,7 @@
>  extern void *alloc_vpages(ulong nr);
>  extern void *alloc_vpage(void);
>  extern void init_alloc_vpage(void *top);
> -extern void setup_vm();
> +extern void setup_vm(void);
>  
>  extern void *setup_mmu(phys_addr_t top);
>  extern phys_addr_t virt_to_pte_phys(pgd_t *pgtable, void *virt);
> 

Applied, thanks.

Paolo



[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