All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-review:Chester-Lin/ACPI-New-eject-flow-to-remove-devices-cautiously/20200104-110159 3/3] drivers//acpi/device_sysfs.c:436:3: note: in expansion of macro 'if'
@ 2020-01-04 10:15 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2020-01-04 10:15 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 6585 bytes --]

tree:   https://github.com/0day-ci/linux/commits/Chester-Lin/ACPI-New-eject-flow-to-remove-devices-cautiously/20200104-110159
head:   cf60e94988dde047a7ff870b33468ff6954de996
commit: cf60e94988dde047a7ff870b33468ff6954de996 [3/3] ACPI / device_sysfs: Add eject_show and add a cancel option in eject_store
config: x86_64-randconfig-s2-20200104 (attached as .config)
compiler: gcc-7 (Debian 7.5.0-3) 7.5.0
reproduce:
        git checkout cf60e94988dde047a7ff870b33468ff6954de996
        # save the attached .config to linux build tree
        make ARCH=x86_64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   In file included from include/linux/ioport.h:13:0,
                    from include/linux/acpi.h:12,
                    from drivers//acpi/device_sysfs.c:14:
   drivers//acpi/device_sysfs.c: In function 'eject_store':
   include/linux/compiler.h:56:26: warning: this statement may fall through [-Wimplicit-fallthrough=]
    #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                             ^
>> drivers//acpi/device_sysfs.c:436:3: note: in expansion of macro 'if'
      if (cancel_eject)
      ^~
   drivers//acpi/device_sysfs.c:438:2: note: here
     default:
     ^~~~~~~
   Cyclomatic Complexity 5 include/linux/compiler.h:__read_once_size
   Cyclomatic Complexity 1 include/linux/list.h:list_empty
   Cyclomatic Complexity 2 drivers//acpi/device_sysfs.c:acpi_data_node_attr_show
   Cyclomatic Complexity 4 include/linux/ctype.h:__tolower
   Cyclomatic Complexity 23 drivers//acpi/device_sysfs.c:create_pnp_modalias
   Cyclomatic Complexity 1 include/acpi/platform/aclinuxex.h:acpi_os_free
   Cyclomatic Complexity 18 drivers//acpi/device_sysfs.c:create_of_modalias
   Cyclomatic Complexity 21 drivers//acpi/device_sysfs.c:__acpi_device_modalias
   Cyclomatic Complexity 1 drivers//acpi/device_sysfs.c:acpi_device_modalias_show
   Cyclomatic Complexity 1 drivers//acpi/device_sysfs.c:acpi_device_modalias
   Cyclomatic Complexity 4 drivers//acpi/device_sysfs.c:real_power_state_show
   Cyclomatic Complexity 1 drivers//acpi/device_sysfs.c:power_state_show
   Cyclomatic Complexity 1 drivers//acpi/device_sysfs.c:acpi_device_uid_show
   Cyclomatic Complexity 4 drivers//acpi/device_sysfs.c:acpi_device_adr_show
   Cyclomatic Complexity 4 drivers//acpi/device_sysfs.c:acpi_object_path
   Cyclomatic Complexity 1 drivers//acpi/device_sysfs.c:acpi_device_path_show
   Cyclomatic Complexity 2 drivers//acpi/device_sysfs.c:data_node_show_path
   Cyclomatic Complexity 49 drivers//acpi/device_sysfs.c:eject_store
   Cyclomatic Complexity 20 drivers//acpi/device_sysfs.c:eject_show
   Cyclomatic Complexity 4 drivers//acpi/device_sysfs.c:status_show
   Cyclomatic Complexity 4 drivers//acpi/device_sysfs.c:acpi_device_hrv_show
   Cyclomatic Complexity 4 drivers//acpi/device_sysfs.c:acpi_device_sun_show
   Cyclomatic Complexity 4 drivers//acpi/device_sysfs.c:description_show
   Cyclomatic Complexity 1 drivers//acpi/device_sysfs.c:acpi_device_hid_show
   Cyclomatic Complexity 1 drivers//acpi/device_sysfs.c:acpi_data_node_release
   Cyclomatic Complexity 1 include/linux/completion.h:__init_completion
   Cyclomatic Complexity 10 drivers//acpi/device_sysfs.c:acpi_expose_nondev_subnodes
   Cyclomatic Complexity 4 drivers//acpi/device_sysfs.c:acpi_hide_nondev_subnodes
   Cyclomatic Complexity 20 drivers//acpi/device_sysfs.c:__acpi_device_uevent_modalias
   Cyclomatic Complexity 1 drivers//acpi/device_sysfs.c:acpi_device_uevent_modalias
   Cyclomatic Complexity 58 drivers//acpi/device_sysfs.c:acpi_device_setup_files
   Cyclomatic Complexity 26 drivers//acpi/device_sysfs.c:acpi_device_remove_files

vim +/if +436 drivers//acpi/device_sysfs.c

   385	
   386	static ssize_t
   387	eject_store(struct device *d, struct device_attribute *attr,
   388			const char *buf, size_t count)
   389	{
   390		struct acpi_device *acpi_device = to_acpi_device(d);
   391		struct eject_data *eject_node = NULL;
   392		acpi_object_type not_used;
   393		acpi_status status;
   394		bool cancel_eject = false;
   395		ssize_t ret;
   396	
   397		if (!count)
   398			return -EINVAL;
   399	
   400		switch (buf[0]) {
   401		case '1':
   402			break;
   403		case '2':
   404			acpi_scan_lock_acquire();
   405			eject_node = (struct eject_data *)acpi_device->eject_stat;
   406	
   407			if (!eject_node) {
   408				acpi_scan_lock_release();
   409				ret = -EINVAL;
   410				goto eject_end;
   411			}
   412	
   413			/*
   414			 * Find a root to start cancellation from the top
   415			 */
   416			if (eject_node->base.root_handle) {
   417				acpi_device = acpi_bus_get_acpi_device(
   418						eject_node->base.root_handle);
   419	
   420				if (acpi_device)
   421					eject_node =
   422					   (struct eject_data *)acpi_device->eject_stat;
   423				else
   424					eject_node = NULL;
   425	
   426			}
   427	
   428			if (eject_node &&
   429			   (eject_node->status == ACPI_EJECT_STATUS_GOING_OFFLINE ||
   430			    eject_node->status == ACPI_EJECT_STATUS_READY_REMOVE)) {
   431				eject_node->status = ACPI_EJECT_STATUS_CANCEL;
   432				cancel_eject = true;
   433			}
   434	
   435			acpi_scan_lock_release();
 > 436			if (cancel_eject)
   437				break;
   438		default:
   439			ret = -EINVAL;
   440			goto eject_end;
   441		};
   442	
   443		if ((!acpi_device->handler || !acpi_device->handler->hotplug.enabled)
   444		    && !acpi_device->driver) {
   445			ret = -ENODEV;
   446			goto eject_end;
   447		}
   448	
   449		status = acpi_get_type(acpi_device->handle, &not_used);
   450		if (ACPI_FAILURE(status) || !acpi_device->flags.ejectable) {
   451			ret = -ENODEV;
   452			goto eject_end;
   453		}
   454	
   455		get_device(&acpi_device->dev);
   456		status = acpi_hotplug_schedule(acpi_device, ACPI_OST_EC_OSPM_EJECT);
   457		if (ACPI_SUCCESS(status)) {
   458			ret = count;
   459			goto eject_end;
   460		}
   461	
   462		put_device(&acpi_device->dev);
   463		acpi_evaluate_ost(acpi_device->handle, ACPI_OST_EC_OSPM_EJECT,
   464				  ACPI_OST_SC_NON_SPECIFIC_FAILURE, NULL);
   465		ret = (status == AE_NO_MEMORY) ? -ENOMEM : -EAGAIN;
   466	
   467	eject_end:
   468		return ret;
   469	

---
0-DAY kernel test infrastructure                 Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 31440 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-01-04 10:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-04 10:15 [linux-review:Chester-Lin/ACPI-New-eject-flow-to-remove-devices-cautiously/20200104-110159 3/3] drivers//acpi/device_sysfs.c:436:3: note: in expansion of macro 'if' kbuild test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.