Re: [PATCH V6 2/8] misc/pvpanic: simplify the code using acpi_dev_resource_io

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

 



Hi Peng,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on char-misc/char-misc-testing]
[also build test ERROR on v4.19 next-20181102]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Peng-Hao/pvpanic-move-pvpanic-to-misc-as-common-driver/20181102-124907
config: sh-allyesconfig (attached as .config)
compiler: sh4-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.2.0 make.cross ARCH=sh 

All errors (new ones prefixed by >>):

   drivers//misc/pvpanic.c:36:36: error: array type has incomplete element type 'struct acpi_device_id'
    static const struct acpi_device_id pvpanic_device_ids[] = {
                                       ^~~~~~~~~~~~~~~~~~
   drivers//misc/pvpanic.c:46:15: error: variable 'pvpanic_driver' has initializer but incomplete type
    static struct acpi_driver pvpanic_driver = {
                  ^~~~~~~~~~~
   drivers//misc/pvpanic.c:47:3: error: 'struct acpi_driver' has no member named 'name'
     .name =  "pvpanic",
      ^~~~
   drivers//misc/pvpanic.c:47:11: warning: excess elements in struct initializer
     .name =  "pvpanic",
              ^~~~~~~~~
   drivers//misc/pvpanic.c:47:11: note: (near initialization for 'pvpanic_driver')
   drivers//misc/pvpanic.c:48:3: error: 'struct acpi_driver' has no member named 'class'
     .class = "QEMU",
      ^~~~~
   drivers//misc/pvpanic.c:48:11: warning: excess elements in struct initializer
     .class = "QEMU",
              ^~~~~~
   drivers//misc/pvpanic.c:48:11: note: (near initialization for 'pvpanic_driver')
   drivers//misc/pvpanic.c:49:3: error: 'struct acpi_driver' has no member named 'ids'
     .ids =  pvpanic_device_ids,
      ^~~
   drivers//misc/pvpanic.c:49:10: warning: excess elements in struct initializer
     .ids =  pvpanic_device_ids,
             ^~~~~~~~~~~~~~~~~~
   drivers//misc/pvpanic.c:49:10: note: (near initialization for 'pvpanic_driver')
   drivers//misc/pvpanic.c:50:3: error: 'struct acpi_driver' has no member named 'ops'
     .ops =  {
      ^~~
   drivers//misc/pvpanic.c:50:10: error: extra brace group at end of initializer
     .ops =  {
             ^
   drivers//misc/pvpanic.c:50:10: note: (near initialization for 'pvpanic_driver')
   drivers//misc/pvpanic.c:50:10: warning: excess elements in struct initializer
   drivers//misc/pvpanic.c:50:10: note: (near initialization for 'pvpanic_driver')
   drivers//misc/pvpanic.c:54:3: error: 'struct acpi_driver' has no member named 'owner'
     .owner = THIS_MODULE,
      ^~~~~
   In file included from include/linux/linkage.h:7:0,
                    from include/linux/kernel.h:7,
                    from drivers//misc/pvpanic.c:23:
   include/linux/export.h:18:21: warning: excess elements in struct initializer
    #define THIS_MODULE ((struct module *)0)
                        ^
   drivers//misc/pvpanic.c:54:11: note: in expansion of macro 'THIS_MODULE'
     .owner = THIS_MODULE,
              ^~~~~~~~~~~
   include/linux/export.h:18:21: note: (near initialization for 'pvpanic_driver')
    #define THIS_MODULE ((struct module *)0)
                        ^
   drivers//misc/pvpanic.c:54:11: note: in expansion of macro 'THIS_MODULE'
     .owner = THIS_MODULE,
              ^~~~~~~~~~~
   drivers//misc/pvpanic.c: In function 'pvpanic_send_event':
   drivers//misc/pvpanic.c:60:2: error: implicit declaration of function 'outb' [-Werror=implicit-function-declaration]
     outb(event, port);
     ^~~~
   drivers//misc/pvpanic.c: In function 'pvpanic_walk_resources':
>> drivers//misc/pvpanic.c:82:6: error: implicit declaration of function 'acpi_dev_resource_io'; did you mean 'acpi_walk_resources'? [-Werror=implicit-function-declaration]
     if (acpi_dev_resource_io(res, &r)) {
         ^~~~~~~~~~~~~~~~~~~~
         acpi_walk_resources
   drivers//misc/pvpanic.c: In function 'pvpanic_add':
   drivers//misc/pvpanic.c:94:8: error: implicit declaration of function 'acpi_bus_get_status'; did you mean 'acpi_get_gpe_status'? [-Werror=implicit-function-declaration]
     ret = acpi_bus_get_status(device);
           ^~~~~~~~~~~~~~~~~~~
           acpi_get_gpe_status
   drivers//misc/pvpanic.c:98:13: error: dereferencing pointer to incomplete type 'struct acpi_device'
     if (!device->status.enabled || !device->status.functional)
                ^~
   drivers//misc/pvpanic.c: At top level:
   drivers//misc/pvpanic.c:121:1: warning: data definition has no type or storage class
    module_acpi_driver(pvpanic_driver);
    ^~~~~~~~~~~~~~~~~~
   drivers//misc/pvpanic.c:121:1: error: type defaults to 'int' in declaration of 'module_acpi_driver' [-Werror=implicit-int]
   drivers//misc/pvpanic.c:121:1: warning: parameter names (without types) in function declaration
   drivers//misc/pvpanic.c:46:27: error: storage size of 'pvpanic_driver' isn't known
    static struct acpi_driver pvpanic_driver = {
                              ^~~~~~~~~~~~~~
   drivers//misc/pvpanic.c:46:27: warning: 'pvpanic_driver' defined but not used [-Wunused-variable]
   drivers//misc/pvpanic.c:36:36: warning: 'pvpanic_device_ids' defined but not used [-Wunused-variable]
    static const struct acpi_device_id pvpanic_device_ids[] = {
                                       ^~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +82 drivers//misc/pvpanic.c

    45	
    46	static struct acpi_driver pvpanic_driver = {
    47		.name =		"pvpanic",
    48		.class =	"QEMU",
    49		.ids =		pvpanic_device_ids,
    50		.ops =		{
    51					.add =		pvpanic_add,
    52					.remove =	pvpanic_remove,
    53				},
  > 54		.owner =	THIS_MODULE,
    55	};
    56	
    57	static void
    58	pvpanic_send_event(unsigned int event)
    59	{
    60		outb(event, port);
    61	}
    62	
    63	static int
    64	pvpanic_panic_notify(struct notifier_block *nb, unsigned long code,
    65			     void *unused)
    66	{
    67		pvpanic_send_event(PVPANIC_PANICKED);
    68		return NOTIFY_DONE;
    69	}
    70	
    71	static struct notifier_block pvpanic_panic_nb = {
    72		.notifier_call = pvpanic_panic_notify,
    73		.priority = 1, /* let this called before broken drm_fb_helper */
    74	};
    75	
    76	
    77	static acpi_status
    78	pvpanic_walk_resources(struct acpi_resource *res, void *context)
    79	{
    80		struct resource r;
    81	
  > 82		if (acpi_dev_resource_io(res, &r)) {
    83			port = r.start;
    84			return AE_OK;
    85		}
    86	
    87		return AE_ERROR;
    88	}
    89	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux