]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/dbus: simplify bus_done_{api,system} functions
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 30 May 2018 11:22:18 +0000 (11:22 +0000)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 31 May 2018 18:42:07 +0000 (20:42 +0200)
destroy_bus already has a check for NULL, so we don't need to repeat it here.

src/core/dbus.c

index e535d9eda9e9c54d629fb52d50ed41fc609beab4..b206f3af56ccb802a45c0a0c7df73c386e071834 100644 (file)
@@ -1098,17 +1098,11 @@ static void destroy_bus(Manager *m, sd_bus **bus) {
 }
 
 void bus_done_api(Manager *m) {
-        assert(m);
-
-        if (m->api_bus)
-                destroy_bus(m, &m->api_bus);
+        destroy_bus(m, &m->api_bus);
 }
 
 void bus_done_system(Manager *m) {
-        assert(m);
-
-        if (m->system_bus)
-                destroy_bus(m, &m->system_bus);
+        destroy_bus(m, &m->system_bus);
 }
 
 void bus_done_private(Manager *m) {