linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [rafael-pm:bleeding-edge 209/212] drivers/acpi/battery.c:1267:2: error: expected expression
@ 2025-09-28  9:39 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-09-28  9:39 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: llvm, oe-kbuild-all, linux-acpi, linux-pm

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git bleeding-edge
head:   95b83771c9f38207ff42311ccc4739db76d19f33
commit: ef688d5100e8f263ae94a2c86260e7231d600c84 [209/212] ACPI: battery: Add synchronization between interface updates
config: riscv-allyesconfig (https://download.01.org/0day-ci/archive/20250928/202509281730.ovd46eNe-lkp@intel.com/config)
compiler: clang version 16.0.6 (https://github.com/llvm/llvm-project 7cbf1a2591520c2491aa35339f227775f4d3adf6)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250928/202509281730.ovd46eNe-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202509281730.ovd46eNe-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/acpi/battery.c:1267:2: error: expected expression
           guard(mutex)(&battery->update_lock);
           ^
   include/linux/cleanup.h:401:2: note: expanded from macro 'guard'
           CLASS(_name, __UNIQUE_ID(guard))
           ^
   include/linux/cleanup.h:290:2: note: expanded from macro 'CLASS'
           class_##_name##_t var __cleanup(class_##_name##_destructor) =   \
           ^
   <scratch space>:99:1: note: expanded from here
   class_mutex_t
   ^
   1 error generated.


vim +1267 drivers/acpi/battery.c

  1212	
  1213	static int acpi_battery_add(struct acpi_device *device)
  1214	{
  1215		int result = 0;
  1216		struct acpi_battery *battery;
  1217	
  1218		if (!device)
  1219			return -EINVAL;
  1220	
  1221		if (device->dep_unmet)
  1222			return -EPROBE_DEFER;
  1223	
  1224		battery = devm_kzalloc(&device->dev, sizeof(*battery), GFP_KERNEL);
  1225		if (!battery)
  1226			return -ENOMEM;
  1227		battery->device = device;
  1228		strscpy(acpi_device_name(device), ACPI_BATTERY_DEVICE_NAME);
  1229		strscpy(acpi_device_class(device), ACPI_BATTERY_CLASS);
  1230		device->driver_data = battery;
  1231		result = devm_mutex_init(&device->dev, &battery->lock);
  1232		if (result)
  1233			return result;
  1234	
  1235		result = devm_mutex_init(&device->dev, &battery->update_lock);
  1236		if (result)
  1237			return result;
  1238	
  1239		if (acpi_has_method(battery->device->handle, "_BIX"))
  1240			set_bit(ACPI_BATTERY_XINFO_PRESENT, &battery->flags);
  1241	
  1242		result = acpi_battery_update_retry(battery);
  1243		if (result)
  1244			goto fail;
  1245	
  1246		pr_info("Slot [%s] (battery %s)\n", acpi_device_bid(device),
  1247			device->status.battery_present ? "present" : "absent");
  1248	
  1249		battery->pm_nb.notifier_call = battery_notify;
  1250		result = register_pm_notifier(&battery->pm_nb);
  1251		if (result)
  1252			goto fail;
  1253	
  1254		device_init_wakeup(&device->dev, 1);
  1255	
  1256		result = acpi_dev_install_notify_handler(device, ACPI_ALL_NOTIFY,
  1257							 acpi_battery_notify, device);
  1258		if (result)
  1259			goto fail_pm;
  1260	
  1261		return 0;
  1262	
  1263	fail_pm:
  1264		device_init_wakeup(&device->dev, 0);
  1265		unregister_pm_notifier(&battery->pm_nb);
  1266	fail:
> 1267		guard(mutex)(&battery->update_lock);
  1268	
  1269		sysfs_remove_battery(battery);
  1270	
  1271		return result;
  1272	}
  1273	

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

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

only message in thread, other threads:[~2025-09-28  9:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-28  9:39 [rafael-pm:bleeding-edge 209/212] drivers/acpi/battery.c:1267:2: error: expected expression kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).