diff options
author | David Tardon <dtardon@redhat.com> | 2022-08-09 14:35:15 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2022-09-13 08:13:27 +0200 |
commit | 995340074e554b4bf4a0fdb0cb7436692c5a4ffd (patch) | |
tree | ca3ee001db3e608ee80478f42fea9c3b409f1b7b /src/login/logind.c | |
parent | Merge pull request #23087 from yuwata/udev-watch (diff) | |
download | systemd-995340074e554b4bf4a0fdb0cb7436692c5a4ffd.tar.xz systemd-995340074e554b4bf4a0fdb0cb7436692c5a4ffd.zip |
tree-wide: use ASSERT_PTR more
Diffstat (limited to 'src/login/logind.c')
-rw-r--r-- | src/login/logind.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/login/logind.c b/src/login/logind.c index ebea23f01d..95c5526711 100644 --- a/src/login/logind.c +++ b/src/login/logind.c @@ -540,9 +540,8 @@ static int manager_enumerate_inhibitors(Manager *m) { } static int manager_dispatch_seat_udev(sd_device_monitor *monitor, sd_device *device, void *userdata) { - Manager *m = userdata; + Manager *m = ASSERT_PTR(userdata); - assert(m); assert(device); manager_process_seat_device(m, device); @@ -550,9 +549,8 @@ static int manager_dispatch_seat_udev(sd_device_monitor *monitor, sd_device *dev } static int manager_dispatch_device_udev(sd_device_monitor *monitor, sd_device *device, void *userdata) { - Manager *m = userdata; + Manager *m = ASSERT_PTR(userdata); - assert(m); assert(device); manager_process_seat_device(m, device); @@ -560,10 +558,9 @@ static int manager_dispatch_device_udev(sd_device_monitor *monitor, sd_device *d } static int manager_dispatch_vcsa_udev(sd_device_monitor *monitor, sd_device *device, void *userdata) { - Manager *m = userdata; + Manager *m = ASSERT_PTR(userdata); const char *name; - assert(m); assert(device); /* Whenever a VCSA device is removed try to reallocate our @@ -578,9 +575,8 @@ static int manager_dispatch_vcsa_udev(sd_device_monitor *monitor, sd_device *dev } static int manager_dispatch_button_udev(sd_device_monitor *monitor, sd_device *device, void *userdata) { - Manager *m = userdata; + Manager *m = ASSERT_PTR(userdata); - assert(m); assert(device); manager_process_button_device(m, device); @@ -588,9 +584,8 @@ static int manager_dispatch_button_udev(sd_device_monitor *monitor, sd_device *d } static int manager_dispatch_console(sd_event_source *s, int fd, uint32_t revents, void *userdata) { - Manager *m = userdata; + Manager *m = ASSERT_PTR(userdata); - assert(m); assert(m->seat0); assert(m->console_active_fd == fd); @@ -943,13 +938,11 @@ static void manager_gc(Manager *m, bool drop_not_started) { } static int manager_dispatch_idle_action(sd_event_source *s, uint64_t t, void *userdata) { - Manager *m = userdata; + Manager *m = ASSERT_PTR(userdata); struct dual_timestamp since; usec_t n, elapse; int r; - assert(m); - if (m->idle_action == HANDLE_IGNORE || m->idle_action_usec <= 0) return 0; |