summaryrefslogtreecommitdiffstats
path: root/src/partition
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2021-08-20 10:54:49 +0200
committerLennart Poettering <lennart@poettering.net>2021-08-20 11:09:48 +0200
commit85b55869bc1065754fdd35ef43ff324cc5e3ef2e (patch)
tree013fe377acb8a8617c700af9b14fa3be95acb06c /src/partition
parentsd-id128: add compound literal love to sd_id128_to_string() + id128_to_uuid_s... (diff)
downloadsystemd-85b55869bc1065754fdd35ef43ff324cc5e3ef2e.tar.xz
systemd-85b55869bc1065754fdd35ef43ff324cc5e3ef2e.zip
tree-wide: port everything over to new sd-id128 compund literal bliss
Diffstat (limited to 'src/partition')
-rw-r--r--src/partition/repart.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/partition/repart.c b/src/partition/repart.c
index e3080864b4..d056745c09 100644
--- a/src/partition/repart.c
+++ b/src/partition/repart.c
@@ -2115,7 +2115,6 @@ static void context_bar_char_process_partition(
static int partition_hint(const Partition *p, const char *node, char **ret) {
_cleanup_free_ char *buf = NULL;
- char ids[ID128_UUID_STRING_MAX];
const char *label;
sd_id128_t id;
@@ -2144,7 +2143,7 @@ static int partition_hint(const Partition *p, const char *node, char **ret) {
else
id = p->type_uuid;
- buf = strdup(id128_to_uuid_string(id, ids));
+ buf = strdup(ID128_TO_UUID_STRING(id));
done:
if (!buf)
@@ -2544,7 +2543,6 @@ static int partition_encrypt(
_cleanup_(sym_crypt_freep) struct crypt_device *cd = NULL;
_cleanup_(erase_and_freep) void *volume_key = NULL;
_cleanup_free_ char *dm_name = NULL, *vol = NULL;
- char suuid[ID128_UUID_STRING_MAX];
size_t volume_key_size = 256 / 8;
sd_id128_t uuid;
int r;
@@ -2591,7 +2589,7 @@ static int partition_encrypt(
CRYPT_LUKS2,
"aes",
"xts-plain64",
- id128_to_uuid_string(uuid, suuid),
+ ID128_TO_UUID_STRING(uuid),
volume_key,
volume_key_size,
&(struct crypt_params_luks2) {
@@ -3340,11 +3338,9 @@ static int context_mangle_partitions(Context *context) {
}
if (!sd_id128_equal(p->new_uuid, p->current_uuid)) {
- char buf[ID128_UUID_STRING_MAX];
-
assert(!sd_id128_is_null(p->new_uuid));
- r = fdisk_partition_set_uuid(p->current_partition, id128_to_uuid_string(p->new_uuid, buf));
+ r = fdisk_partition_set_uuid(p->current_partition, ID128_TO_UUID_STRING(p->new_uuid));
if (r < 0)
return log_error_errno(r, "Failed to set partition UUID: %m");
@@ -3371,7 +3367,6 @@ static int context_mangle_partitions(Context *context) {
} else {
_cleanup_(fdisk_unref_partitionp) struct fdisk_partition *q = NULL;
_cleanup_(fdisk_unref_parttypep) struct fdisk_parttype *t = NULL;
- char ids[ID128_UUID_STRING_MAX];
assert(!p->new_partition);
assert(p->offset % 512 == 0);
@@ -3383,7 +3378,7 @@ static int context_mangle_partitions(Context *context) {
if (!t)
return log_oom();
- r = fdisk_parttype_set_typestr(t, id128_to_uuid_string(p->type_uuid, ids));
+ r = fdisk_parttype_set_typestr(t, ID128_TO_UUID_STRING(p->type_uuid));
if (r < 0)
return log_error_errno(r, "Failed to initialize partition type: %m");
@@ -3411,7 +3406,7 @@ static int context_mangle_partitions(Context *context) {
if (r < 0)
return log_error_errno(r, "Failed to set partition number: %m");
- r = fdisk_partition_set_uuid(q, id128_to_uuid_string(p->new_uuid, ids));
+ r = fdisk_partition_set_uuid(q, ID128_TO_UUID_STRING(p->new_uuid));
if (r < 0)
return log_error_errno(r, "Failed to set partition UUID: %m");