[intel-tdx:guest 70/113] include/linux/protected_guest.h:51:49: warning: declaration of 'struct device' will not be visible outside of this function

From: kernel test robot
Date: Fri Aug 27 2021 - 17:44:07 EST


tree: https://github.com/intel/tdx.git guest
head: 44e41606b85b08fad5378c876547f8557f835cf6
commit: b3bb395b4eaa3d107b203d30dcf6dcc6d1d2fa29 [70/113] mm: Add prot_guest_authorized() interface
config: i386-randconfig-r001-20210827 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 1076082a0d97bd5c16a25ee7cf3dbb6ee4b5a9fe)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel/tdx/commit/b3bb395b4eaa3d107b203d30dcf6dcc6d1d2fa29
git remote add intel-tdx https://github.com/intel/tdx.git
git fetch --no-tags intel-tdx guest
git checkout b3bb395b4eaa3d107b203d30dcf6dcc6d1d2fa29
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=i386

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

In file included from arch/x86/kernel/platform-quirks.c:6:
In file included from arch/x86/include/asm/bios_ebda.h:5:
In file included from arch/x86/include/asm/io.h:43:
>> include/linux/protected_guest.h:51:49: warning: declaration of 'struct device' will not be visible outside of this function [-Wvisibility]
static inline bool prot_guest_authorized(struct device *dev, char *dev_str)
^
include/linux/protected_guest.h:53:12: error: incomplete definition of type 'struct device'
return dev->authorized;
~~~^
include/linux/protected_guest.h:51:49: note: forward declaration of 'struct device'
static inline bool prot_guest_authorized(struct device *dev, char *dev_str)
^
arch/x86/kernel/platform-quirks.c:42:13: warning: no previous prototype for function 'arch_pnpbios_disabled' [-Wmissing-prototypes]
bool __init arch_pnpbios_disabled(void)
^
arch/x86/kernel/platform-quirks.c:42:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
bool __init arch_pnpbios_disabled(void)
^
static
2 warnings and 1 error generated.
--
In file included from arch/x86/kernel/devicetree.c:6:
In file included from include/linux/io.h:13:
In file included from arch/x86/include/asm/io.h:43:
>> include/linux/protected_guest.h:51:49: warning: declaration of 'struct device' will not be visible outside of this function [-Wvisibility]
static inline bool prot_guest_authorized(struct device *dev, char *dev_str)
^
include/linux/protected_guest.h:53:12: error: incomplete definition of type 'struct device'
return dev->authorized;
~~~^
include/linux/protected_guest.h:51:49: note: forward declaration of 'struct device'
static inline bool prot_guest_authorized(struct device *dev, char *dev_str)
^
arch/x86/kernel/devicetree.c:34:13: warning: no previous prototype for function 'early_init_dt_scan_chosen_arch' [-Wmissing-prototypes]
void __init early_init_dt_scan_chosen_arch(unsigned long node)
^
arch/x86/kernel/devicetree.c:34:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void __init early_init_dt_scan_chosen_arch(unsigned long node)
^
static
arch/x86/kernel/devicetree.c:39:13: warning: no previous prototype for function 'early_init_dt_add_memory_arch' [-Wmissing-prototypes]
void __init early_init_dt_add_memory_arch(u64 base, u64 size)
^
arch/x86/kernel/devicetree.c:39:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void __init early_init_dt_add_memory_arch(u64 base, u64 size)
^
static
3 warnings and 1 error generated.
--
In file included from drivers/misc/vmw_balloon.c:20:
In file included from include/linux/io.h:13:
In file included from arch/x86/include/asm/io.h:43:
>> include/linux/protected_guest.h:51:49: warning: declaration of 'struct device' will not be visible outside of this function [-Wvisibility]
static inline bool prot_guest_authorized(struct device *dev, char *dev_str)
^
include/linux/protected_guest.h:53:12: error: incomplete definition of type 'struct device'
return dev->authorized;
~~~^
include/linux/protected_guest.h:51:49: note: forward declaration of 'struct device'
static inline bool prot_guest_authorized(struct device *dev, char *dev_str)
^
1 warning and 1 error generated.
--
In file included from kernel/dma/direct.c:7:
In file included from include/linux/memblock.h:14:
In file included from arch/x86/include/asm/dma.h:13:
In file included from arch/x86/include/asm/io.h:43:
include/linux/protected_guest.h:53:12: error: incomplete definition of type 'struct device'
return dev->authorized;
~~~^
include/linux/bitmap.h:13:8: note: forward declaration of 'struct device'
struct device;
^
>> kernel/dma/direct.c:102:20: warning: shift count >= width of type [-Wshift-count-overflow]
phys_limit < DMA_BIT_MASK(64) &&
^~~~~~~~~~~~~~~~
include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK'
#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
^ ~~~
1 warning and 1 error generated.


vim +51 include/linux/protected_guest.h

40
41 /*
42 * prot_guest_authorized() - Used to get ARCH specific authorized status of
43 * given device.
44 * @dev - device structure
45 * @dev_str - device search string (for PCI bus it is vendor:device, other
46 * bus device may use dev_name(dev))
47 *
48 * Return True to allow the device or False to deny it.
49 *
50 */
> 51 static inline bool prot_guest_authorized(struct device *dev, char *dev_str)
52 {
53 return dev->authorized;
54 }
55

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip