summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2018-12-03 18:23:06 +0100
committerBeniamino Galvani <bgalvani@redhat.com>2018-12-12 14:18:53 +0100
commit3e4b30b2b180b069dcd20520192d93bb05c96d4b (patch)
treeb49a4e85710d6fa9a0ed15d4a10e6c91611de3b9
parent5780a2893b2adc1a3cafd45dcf2d2c09bf7e15c3 (diff)
downloadNetworkManager-3e4b30b2b180b069dcd20520192d93bb05c96d4b.tar.gz
udev: remove unneeded NULL checks
self->monitor cannot be NULL there.
-rw-r--r--shared/nm-utils/nm-udev-utils.c32
1 files changed, 14 insertions, 18 deletions
diff --git a/shared/nm-utils/nm-udev-utils.c b/shared/nm-utils/nm-udev-utils.c
index 397d575b91..5d0919b302 100644
--- a/shared/nm-utils/nm-udev-utils.c
+++ b/shared/nm-utils/nm-udev-utils.c
@@ -241,27 +241,23 @@ nm_udev_client_new (const char *const*subsystems,
if (self->subsystems) {
/* install subsystem filters to only wake up for certain events */
for (n = 0; self->subsystems[n]; n++) {
- if (self->monitor) {
- gs_free char *to_free = NULL;
- const char *subsystem;
- const char *devtype;
-
- _subsystem_split (self->subsystems[n], &subsystem, &devtype, &to_free);
- udev_monitor_filter_add_match_subsystem_devtype (self->monitor, subsystem, devtype);
- }
+ gs_free char *to_free = NULL;
+ const char *subsystem;
+ const char *devtype;
+
+ _subsystem_split (self->subsystems[n], &subsystem, &devtype, &to_free);
+ udev_monitor_filter_add_match_subsystem_devtype (self->monitor, subsystem, devtype);
}
/* listen to events, and buffer them */
- if (self->monitor) {
- udev_monitor_set_receive_buffer_size (self->monitor, 4*1024*1024);
- udev_monitor_enable_receiving (self->monitor);
- channel = g_io_channel_unix_new (udev_monitor_get_fd (self->monitor));
- self->watch_source = g_io_create_watch (channel, G_IO_IN);
- g_io_channel_unref (channel);
- g_source_set_callback (self->watch_source, (GSourceFunc)(void (*) (void)) monitor_event, self, NULL);
- g_source_attach (self->watch_source, g_main_context_get_thread_default ());
- g_source_unref (self->watch_source);
- }
+ udev_monitor_set_receive_buffer_size (self->monitor, 4*1024*1024);
+ udev_monitor_enable_receiving (self->monitor);
+ channel = g_io_channel_unix_new (udev_monitor_get_fd (self->monitor));
+ self->watch_source = g_io_create_watch (channel, G_IO_IN);
+ g_io_channel_unref (channel);
+ g_source_set_callback (self->watch_source, (GSourceFunc)(void (*) (void)) monitor_event, self, NULL);
+ g_source_attach (self->watch_source, g_main_context_get_thread_default ());
+ g_source_unref (self->watch_source);
}
}