summaryrefslogtreecommitdiff
path: root/src/udev/udevadm-info.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-04-25 12:31:45 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-04-25 12:31:45 +0200
commit8e766630f006fcb17ad575bd4f3000e2d2dc890f (patch)
tree5b80e86c17142add180769d82db29e2627874304 /src/udev/udevadm-info.c
parent0d6f0ea6c1994a5769704d2150ce907a1132a8c8 (diff)
downloadsystemd-8e766630f006fcb17ad575bd4f3000e2d2dc890f.tar.gz
tree-wide: drop redundant _cleanup_ macros (#8810)
This drops a good number of type-specific _cleanup_ macros, and patches all users to just use the generic ones. In most recent code we abstained from defining type-specific macros, and this basically removes all those added already, with the exception of the really low-level ones. Having explicit macros for this is not too useful, as the expression without the extra macro is generally just 2ch wider. We should generally emphesize generic code, unless there are really good reasons for specific code, hence let's follow this in this case too. Note that _cleanup_free_ and similar really low-level, libc'ish, Linux API'ish macros continue to be defined, only the really high-level OO ones are dropped. From now on this should really be the rule: for really low-level stuff, such as memory allocation, fd handling and so one, go ahead and define explicit per-type macros, but for high-level, specific program code, just use the generic _cleanup_() macro directly, in order to keep things simple and as readable as possible for the uninitiated. Note that before this patch some of the APIs (notable libudev ones) were already used with the high-level macros at some places and with the generic _cleanup_ macro at others. With this patch we hence unify on the latter.
Diffstat (limited to 'src/udev/udevadm-info.c')
-rw-r--r--src/udev/udevadm-info.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/udev/udevadm-info.c b/src/udev/udevadm-info.c
index 580e95095b..ab81c0a501 100644
--- a/src/udev/udevadm-info.c
+++ b/src/udev/udevadm-info.c
@@ -173,7 +173,7 @@ static int stat_device(const char *name, bool export, const char *prefix) {
}
static int export_devices(struct udev *udev) {
- _cleanup_udev_enumerate_unref_ struct udev_enumerate *udev_enumerate;
+ _cleanup_(udev_enumerate_unrefp) struct udev_enumerate *udev_enumerate;
struct udev_list_entry *list_entry;
udev_enumerate = udev_enumerate_new(udev);
@@ -182,7 +182,7 @@ static int export_devices(struct udev *udev) {
udev_enumerate_scan_devices(udev_enumerate);
udev_list_entry_foreach(list_entry, udev_enumerate_get_list_entry(udev_enumerate)) {
- _cleanup_udev_device_unref_ struct udev_device *device;
+ _cleanup_(udev_device_unrefp) struct udev_device *device;
device = udev_device_new_from_syspath(udev, udev_list_entry_get_name(list_entry));
if (device != NULL)
@@ -272,7 +272,7 @@ static void help(void) {
}
static int uinfo(struct udev *udev, int argc, char *argv[]) {
- _cleanup_udev_device_unref_ struct udev_device *device = NULL;
+ _cleanup_(udev_device_unrefp) struct udev_device *device = NULL;
bool root = 0;
bool export = 0;
const char *export_prefix = NULL;