From: kernel test robot <lkp@intel.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
linux-acpi@vger.kernel.org, linux-pm@vger.kernel.org
Subject: [rafael-pm:bleeding-edge 209/212] drivers/acpi/battery.c:1267:2: error: expected expression
Date: Sun, 28 Sep 2025 17:39:01 +0800 [thread overview]
Message-ID: <202509281730.ovd46eNe-lkp@intel.com> (raw)
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
reply other threads:[~2025-09-28 9:40 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202509281730.ovd46eNe-lkp@intel.com \
--to=lkp@intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=rjw@rjwysocki.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).