From: Lennart Poettering Date: Wed, 5 Nov 2025 21:27:33 +0000 (+0100) Subject: pull: use ASSERT_PTR() to shorten code a tiny bit X-Git-Tag: v259-rc1~127^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7aa847933f8aaf3ce4bd6e22d3c59c5691c0cbe3;p=thirdparty%2Fsystemd.git pull: use ASSERT_PTR() to shorten code a tiny bit --- diff --git a/src/import/pull-raw.c b/src/import/pull-raw.c index bf662c24b95..ef10745ba85 100644 --- a/src/import/pull-raw.c +++ b/src/import/pull-raw.c @@ -500,13 +500,10 @@ static int raw_pull_rename_auxiliary_file( } static void raw_pull_job_on_finished(PullJob *j) { - RawPull *i; int r; assert(j); - assert(j->userdata); - - i = j->userdata; + RawPull *i = ASSERT_PTR(j->userdata); if (j->error != 0) { /* Only the main job and the checksum job are fatal if they fail. The other fails are just diff --git a/src/import/pull-tar.c b/src/import/pull-tar.c index 168ea08de84..05b58f79764 100644 --- a/src/import/pull-tar.c +++ b/src/import/pull-tar.c @@ -399,13 +399,10 @@ static bool tar_pull_is_done(TarPull *i) { } static void tar_pull_job_on_finished(PullJob *j) { - TarPull *i; int r; assert(j); - assert(j->userdata); - - i = j->userdata; + TarPull *i = ASSERT_PTR(j->userdata); if (j->error != 0) { clear_progress_bar(/* prefix= */ NULL); @@ -582,13 +579,11 @@ finish: static int tar_pull_job_on_open_disk_tar(PullJob *j) { const char *where; - TarPull *i; int r; assert(j); - assert(j->userdata); - i = j->userdata; + TarPull *i = ASSERT_PTR(j->userdata); assert(i->tar_job == j); assert(!pidref_is_set(&i->tar_pid)); assert(i->tree_fd < 0);