int job_get_timeout(Job *j, usec_t *timeout) {
usec_t x = USEC_INFINITY, y = USEC_INFINITY;
- Unit *u;
+ Unit *u = ASSERT_PTR(ASSERT_PTR(j)->unit);
int r;
- assert(j);
-
- u = ASSERT_PTR(j->unit);
-
if (j->timer_event_source) {
r = sd_event_source_get_time(j->timer_event_source, &x);
if (r < 0)
}
void unit_add_to_target_deps_queue(Unit *u) {
- Manager *m;
-
- assert(u);
-
- m = ASSERT_PTR(u->manager);
+ Manager *m = ASSERT_PTR(ASSERT_PTR(u)->manager);
if (u->in_target_deps_queue)
return;
}
static int connection_release(Connection *c) {
- Context *context;
+ Context *context = ASSERT_PTR(ASSERT_PTR(c)->context);
int r;
- assert(c);
-
- context = ASSERT_PTR(c->context);
-
connection_free(c);
if (arg_exit_idle_time < USEC_INFINITY && set_isempty(context->connections)) {
size_t l,
bool *ret_truncated) {
- sd_device *parent, *dev;
+ sd_device *parent, *dev = ASSERT_PTR(ASSERT_PTR(event)->dev);
const char *val = NULL;
bool truncated = false;
char *s = dest;
int r;
- assert(event);
-
- dev = ASSERT_PTR(event->dev);
-
switch (type) {
case FORMAT_SUBST_DEVPATH:
r = sd_device_get_devpath(dev, &val);
}
static int update_devnode(UdevEvent *event) {
- sd_device *dev;
+ sd_device *dev = ASSERT_PTR(ASSERT_PTR(event)->dev);
int r;
- assert(event);
-
- dev = ASSERT_PTR(event->dev);
-
r = sd_device_get_devnum(dev, NULL);
if (r == -ENOENT)
return 0;
Hashmap *properties_list,
UdevRules *rules) {
- sd_device *dev;
+ sd_device *dev = ASSERT_PTR(ASSERT_PTR(event)->dev);
int r;
- assert(event);
-
- dev = ASSERT_PTR(event->dev);
-
r = device_read_db_internal(dev, true);
if (r < 0)
log_device_debug_errno(dev, r, "Failed to read database under /run/udev/data/: %m");