Re: [PATCH v1 13/34] platform/wilco_ec: Move handler installing logic to driver

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

 



Hi Michal,

kernel test robot noticed the following build warnings:

[auto build test WARNING on rafael-pm/linux-next]
[also build test WARNING on chrome-platform/for-next groeck-staging/hwmon-next linus/master v6.4-rc1 next-20230512]
[cannot apply to jic23-iio/togreg nvdimm/libnvdimm-for-next nvdimm/dax-misc crng-random/master]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Michal-Wilczynski/acpi-Adjust-functions-installing-bus-event-handlers/20230512-220607
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
patch link:    https://lore.kernel.org/r/20230512140222.124868-14-michal.wilczynski%40intel.com
patch subject: [PATCH v1 13/34] platform/wilco_ec: Move handler installing logic to driver
config: ia64-allyesconfig (https://download.01.org/0day-ci/archive/20230512/202305122316.bylumx35-lkp@xxxxxxxxx/config)
compiler: ia64-linux-gcc (GCC) 12.1.0
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-lab-lkp/linux/commit/eb24371e3b1a867fba1410400cfc19f6961cff7b
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Michal-Wilczynski/acpi-Adjust-functions-installing-bus-event-handlers/20230512-220607
        git checkout eb24371e3b1a867fba1410400cfc19f6961cff7b
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=ia64 olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=ia64 SHELL=/bin/bash drivers/platform/chrome/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Link: https://lore.kernel.org/oe-kbuild-all/202305122316.bylumx35-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

   drivers/platform/chrome/wilco_ec/event.c: In function 'event_device_notify':
   drivers/platform/chrome/wilco_ec/event.c:256:42: error: expected expression before '=' token
     256 |         struct acpi_buffer event_buffer; = { ACPI_ALLOCATE_BUFFER, NULL };
         |                                          ^
>> drivers/platform/chrome/wilco_ec/event.c:257:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
     257 |         struct acpi_device *adev = data;
         |         ^~~~~~
   drivers/platform/chrome/wilco_ec/event.c: In function 'event_device_add':
   drivers/platform/chrome/wilco_ec/event.c:487:52: error: 'device' undeclared (first use in this function)
     487 |         error =  acpi_device_install_event_handler(device, ACPI_DEVICE_NOTIFY,
         |                                                    ^~~~~~
   drivers/platform/chrome/wilco_ec/event.c:487:52: note: each undeclared identifier is reported only once for each function it appears in
   drivers/platform/chrome/wilco_ec/event.c: In function 'event_device_remove':
   drivers/platform/chrome/wilco_ec/event.c:505:42: error: 'device' undeclared (first use in this function)
     505 |         acpi_device_remove_event_handler(device, ACPI_DEVICE_NOTIFY, event_device_notify);
         |                                          ^~~~~~


vim +257 drivers/platform/chrome/wilco_ec/event.c

   253	
   254	static void event_device_notify(acpi_handle handle, u32 value, void *data)
   255	{
   256		struct acpi_buffer event_buffer; = { ACPI_ALLOCATE_BUFFER, NULL };
 > 257		struct acpi_device *adev = data;
   258		union acpi_object *obj;
   259		acpi_status status;
   260	
   261		if (value != EC_ACPI_NOTIFY_EVENT) {
   262			dev_err(&adev->dev, "Invalid event: 0x%08x\n", value);
   263			return;
   264		}
   265	
   266		/* Execute ACPI method to get event data buffer. */
   267		status = acpi_evaluate_object(adev->handle, EC_ACPI_GET_EVENT,
   268					      NULL, &event_buffer);
   269		if (ACPI_FAILURE(status)) {
   270			dev_err(&adev->dev, "Error executing ACPI method %s()\n",
   271				EC_ACPI_GET_EVENT);
   272			return;
   273		}
   274	
   275		obj = (union acpi_object *)event_buffer.pointer;
   276		if (!obj) {
   277			dev_err(&adev->dev, "Nothing returned from %s()\n",
   278				EC_ACPI_GET_EVENT);
   279			return;
   280		}
   281		if (obj->type != ACPI_TYPE_BUFFER) {
   282			dev_err(&adev->dev, "Invalid object returned from %s()\n",
   283				EC_ACPI_GET_EVENT);
   284			kfree(obj);
   285			return;
   286		}
   287		if (obj->buffer.length < sizeof(struct ec_event)) {
   288			dev_err(&adev->dev, "Invalid buffer length %d from %s()\n",
   289				obj->buffer.length, EC_ACPI_GET_EVENT);
   290			kfree(obj);
   291			return;
   292		}
   293	
   294		enqueue_events(adev, obj->buffer.pointer, obj->buffer.length);
   295		kfree(obj);
   296	}
   297	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests



[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