]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/load-fragment: use ASSERT_PTR where appropriate
authorMike Yuan <me@yhndnzj.com>
Sun, 23 Jun 2024 16:29:29 +0000 (18:29 +0200)
committerMike Yuan <me@yhndnzj.com>
Mon, 24 Jun 2024 13:35:56 +0000 (15:35 +0200)
src/core/load-fragment.c

index deeeafe2b8aa51d516ea7ead24b41d48f59b70ad..a0b20a8d919c2055f4d372609df92e437754d28e 100644 (file)
@@ -3699,15 +3699,14 @@ int config_parse_unit_slice(
                 void *data,
                 void *userdata) {
 
+        Unit *u = ASSERT_PTR(userdata), *slice;
         _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
         _cleanup_free_ char *k = NULL;
-        Unit *u = userdata, *slice;
         int r;
 
         assert(filename);
         assert(lvalue);
         assert(rvalue);
-        assert(u);
 
         r = unit_name_printf(u, rvalue, &k);
         if (r < 0) {
@@ -3908,8 +3907,8 @@ int config_parse_tasks_max(
                 void *data,
                 void *userdata) {
 
-        const Unit *u = userdata;
-        CGroupTasksMax *tasks_max = data;
+        CGroupTasksMax *tasks_max = ASSERT_PTR(data);
+        const Unit *u = ASSERT_PTR(userdata);
         uint64_t v;
         int r;