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:6: warning: this statement may fall through
@ 2020-01-04  5:22 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2020-01-04  5:22 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 3756 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-lkp (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 >>):

   drivers/acpi/device_sysfs.c: In function 'eject_store':
>> drivers/acpi/device_sysfs.c:436:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
      if (cancel_eject)
         ^
   drivers/acpi/device_sysfs.c:438:2: note: here
     default:
     ^~~~~~~

vim +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: 28789 bytes --]

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

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

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-04  5:22 [linux-review:Chester-Lin/ACPI-New-eject-flow-to-remove-devices-cautiously/20200104-110159 3/3] drivers/acpi/device_sysfs.c:436:6: warning: this statement may fall through 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.