RE: [PATCH] SFI: fix compilation warnings

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

 



Hi,

> From: Andy Shevchenko [mailto:andriy.shevchenko@xxxxxxxxxxxxxxx]
> Sent: Friday, December 06, 2013 1:27 AM
> 
> When build kernel with make W=1 we get the following compiler error.
> 
> In file included from drivers/sfi/sfi_acpi.c:66:0:
> include/linux/sfi_acpi.h: In function ‘acpi_sfi_table_parse’:
> include/linux/sfi_acpi.h:72:2: error: implicit declaration of function ‘acpi_table_parse’ [-Werror=implicit-function-declaration]
>   if (!acpi_table_parse(signature, handler))
>   ^
>   cc1: some warnings being treated as errors
> 
> The patch changes acpi/acpi.h inclusion to linux/acpi.h.

Have you tested this patch with:
CONFIG_ACPI=n
CONFIG_SFI=y

Will this trigger build errors like:
> > arch/x86/pci/mmconfig-shared.c:551:13: warning: 'struct acpi_mcfg_allocation' declared inside parameter list [enabled by default]
> > arch/x86/pci/mmconfig-shared.c:551:13: warning: its scope is only this definition or declaration, which is probably not what you want
> [enabled by default]
> > arch/x86/pci/mmconfig-shared.c:551:13: warning: 'struct acpi_table_mcfg' declared inside parameter list [enabled by default]
> > arch/x86/pci/mmconfig-shared.c: In function 'acpi_mcfg_check_entry':
> > arch/x86/pci/mmconfig-shared.c:555:9: error: dereferencing pointer to incomplete type
> > arch/x86/pci/mmconfig-shared.c:558:19: error: dereferencing pointer to incomplete type
> > arch/x86/pci/mmconfig-shared.c:561:10: error: dereferencing pointer to incomplete type
> > arch/x86/pci/mmconfig-shared.c:567:2: error: dereferencing pointer to incomplete type
> > arch/x86/pci/mmconfig-shared.c:567:2: error: dereferencing pointer to incomplete type
> > arch/x86/pci/mmconfig-shared.c:567:2: error: dereferencing pointer to incomplete type
> > arch/x86/pci/mmconfig-shared.c:567:2: error: dereferencing pointer to incomplete type
> > arch/x86/pci/mmconfig-shared.c: In function 'pci_parse_mcfg':
> > arch/x86/pci/mmconfig-shared.c:588:12: error: dereferencing pointer to incomplete type
> > arch/x86/pci/mmconfig-shared.c:588:30: error: invalid application of 'sizeof' to incomplete type 'struct acpi_table_mcfg'
> > arch/x86/pci/mmconfig-shared.c:589:21: error: invalid application of 'sizeof' to incomplete type 'struct acpi_mcfg_allocation'
> > arch/x86/pci/mmconfig-shared.c:591:15: error: invalid application of 'sizeof' to incomplete type 'struct acpi_mcfg_allocation'
> > arch/x86/pci/mmconfig-shared.c:598:22: error: invalid use of undefined type 'struct acpi_table_mcfg'
> > arch/x86/pci/mmconfig-shared.c:598:51: error: dereferencing pointer to incomplete type
> > arch/x86/pci/mmconfig-shared.c:600:3: error: invalid use of undefined type 'struct acpi_mcfg_allocation'
> > arch/x86/pci/mmconfig-shared.c:600:19: error: dereferencing pointer to incomplete type
> > arch/x86/pci/mmconfig-shared.c:601:3: warning: passing argument 1 of 'acpi_mcfg_check_entry' from incompatible pointer type
> [enabled by default]
> > arch/x86/pci/mmconfig-shared.c:550:19: note: expected 'struct acpi_table_mcfg *' but argument is of type 'struct acpi_table_mcfg
> *'
> > arch/x86/pci/mmconfig-shared.c:601:3: warning: passing argument 2 of 'acpi_mcfg_check_entry' from incompatible pointer type
> [enabled by default]
> > arch/x86/pci/mmconfig-shared.c:550:19: note: expected 'struct acpi_mcfg_allocation *' but argument is of type 'struct
> acpi_mcfg_allocation *'
> > arch/x86/pci/mmconfig-shared.c:606:27: error: dereferencing pointer to incomplete type
> > arch/x86/pci/mmconfig-shared.c:606:45: error: dereferencing pointer to incomplete type
> > arch/x86/pci/mmconfig-shared.c:607:11: error: dereferencing pointer to incomplete type
> > arch/x86/pci/mmconfig-shared.c:607:32: error: dereferencing pointer to incomplete type
> > arch/x86/pci/mmconfig-shared.c: In function 'pci_mmcfg_early_init':
> > arch/x86/pci/mmconfig-shared.c:649:25: error: 'ACPI_SIG_MCFG' undeclared (first use in this function)
> > arch/x86/pci/mmconfig-shared.c:649:25: note: each undeclared identifier is reported only once for each function it appears in
> > arch/x86/pci/mmconfig-shared.c: In function 'pci_mmcfg_late_init':
> > arch/x86/pci/mmconfig-shared.c:665:24: error: 'ACPI_SIG_MCFG' undeclared (first use in this function)

Please check.

Thanks
-Lv


> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
> ---
>  drivers/sfi/sfi_acpi.c   | 2 +-
>  include/linux/sfi_acpi.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/sfi/sfi_acpi.c b/drivers/sfi/sfi_acpi.c
> index 0c9f419..d4dfcbe 100644
> --- a/drivers/sfi/sfi_acpi.c
> +++ b/drivers/sfi/sfi_acpi.c
> @@ -60,7 +60,7 @@
>  #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
> 
>  #include <linux/kernel.h>
> -#include <acpi/acpi.h>	/* FIXME: inclusion should be removed */
> +#include <linux/acpi.h>
> 
>  #include <linux/sfi.h>
>  #include <linux/sfi_acpi.h>
> diff --git a/include/linux/sfi_acpi.h b/include/linux/sfi_acpi.h
> index 2cfcb79..c9cab82 100644
> --- a/include/linux/sfi_acpi.h
> +++ b/include/linux/sfi_acpi.h
> @@ -60,7 +60,7 @@
>  #define _LINUX_SFI_ACPI_H
> 
>  #ifdef CONFIG_SFI
> -#include <acpi/acpi.h>	/* FIXME: inclusion should be removed */
> +#include <linux/acpi.h>
> 
>  extern int sfi_acpi_table_parse(char *signature, char *oem_id,
>  				char *oem_table_id,
> --
> 1.8.4.4

��.n��������+%������w��{.n�����{�����ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f





[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux