From: Lennart Poettering Date: Thu, 17 Sep 2020 14:56:09 +0000 (+0200) Subject: dissect: use structured initialization, it's prettier X-Git-Tag: v247-rc1~211^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=943443854311c0f8954735f6ebfd50cdbd455e0c;p=thirdparty%2Fsystemd.git dissect: use structured initialization, it's prettier --- diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c index 2c339e38b85..b704268db24 100644 --- a/src/shared/dissect-image.c +++ b/src/shared/dissect-image.c @@ -1321,9 +1321,10 @@ static int decrypt_partition( return r == -EPERM ? -EKEYREJECTED : r; } - d->decrypted[d->n_decrypted].name = TAKE_PTR(name); - d->decrypted[d->n_decrypted].device = TAKE_PTR(cd); - d->n_decrypted++; + d->decrypted[d->n_decrypted++] = (DecryptedPartition) { + .name = TAKE_PTR(name), + .device = TAKE_PTR(cd), + }; m->decrypted_node = TAKE_PTR(node); @@ -1540,9 +1541,10 @@ static int verity_partition( /* Everything looks good and we'll be able to mount the device, so deferred remove will be re-enabled at that point. */ restore_deferred_remove = mfree(restore_deferred_remove); - d->decrypted[d->n_decrypted].name = TAKE_PTR(name); - d->decrypted[d->n_decrypted].device = TAKE_PTR(cd); - d->n_decrypted++; + d->decrypted[d->n_decrypted++] = (DecryptedPartition) { + .name = TAKE_PTR(name), + .device = TAKE_PTR(cd), + }; m->decrypted_node = TAKE_PTR(node);