* [rafael-pm:bleeding-edge 209/212] drivers/acpi/battery.c:1267:2: warning: label followed by a declaration is a C23 extension
@ 2025-09-27 16:12 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-09-27 16:12 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: loongarch-randconfig-002-20250927 (https://download.01.org/0day-ci/archive/20250928/202509280052.07wgnjdw-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250928/202509280052.07wgnjdw-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/202509280052.07wgnjdw-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/acpi/battery.c:1267:2: warning: label followed by a declaration is a C23 extension [-Wc23-extensions]
1267 | guard(mutex)(&battery->update_lock);
| ^
include/linux/cleanup.h:401:2: note: expanded from macro 'guard'
401 | CLASS(_name, __UNIQUE_ID(guard))
| ^
include/linux/cleanup.h:290:2: note: expanded from macro 'CLASS'
290 | class_##_name##_t var __cleanup(class_##_name##_destructor) = \
| ^
<scratch space>:77:1: note: expanded from here
77 | class_mutex_t
| ^
1 warning 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-27 16:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-27 16:12 [rafael-pm:bleeding-edge 209/212] drivers/acpi/battery.c:1267:2: warning: label followed by a declaration is a C23 extension 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