From: Zbigniew Jędrzejewski-Szmek Date: Mon, 23 Oct 2023 12:59:17 +0000 (+0200) Subject: basic/iovec-util: drop IOVEC_NULL X-Git-Tag: v255-rc1~159^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7dc951ef91bac7b8ab553213709462ef74f60375;p=thirdparty%2Fsystemd.git basic/iovec-util: drop IOVEC_NULL The macro isn't very useful, we can just use the direct setting to increase readability. --- diff --git a/src/basic/iovec-util.h b/src/basic/iovec-util.h index 9c3134592ed..ad6e1275d51 100644 --- a/src/basic/iovec-util.h +++ b/src/basic/iovec-util.h @@ -12,8 +12,6 @@ size_t iovec_total_size(const struct iovec *iovec, size_t n); bool iovec_increment(struct iovec *iovec, size_t n, size_t k); -#define IOVEC_NULL (const struct iovec) {} - #define IOVEC_MAKE(base, len) (struct iovec) { .iov_base = (base), .iov_len = (len) } #define IOVEC_MAKE_STRING(string) \ ({ \ @@ -21,7 +19,7 @@ bool iovec_increment(struct iovec *iovec, size_t n, size_t k); IOVEC_MAKE((char*) _s, strlen(_s)); \ }) -#define TAKE_IOVEC(p) TAKE_GENERIC((p), struct iovec, IOVEC_NULL) +#define TAKE_IOVEC(p) TAKE_GENERIC((p), struct iovec, {}) static inline void iovec_done(struct iovec *iovec) { /* A _cleanup_() helper that frees the iov_base in the iovec */ diff --git a/src/libsystemd/sd-journal/journal-send.c b/src/libsystemd/sd-journal/journal-send.c index 1ca721e6c94..be23b2fe75d 100644 --- a/src/libsystemd/sd-journal/journal-send.c +++ b/src/libsystemd/sd-journal/journal-send.c @@ -530,7 +530,7 @@ _public_ int sd_journal_send_with_location(const char *file, const char *line, c r = sd_journal_sendv(iov, n_iov); - iov[0] = iov[1] = iov[2] = IOVEC_NULL; + iov[0] = iov[1] = iov[2] = (struct iovec) {}; return r; } diff --git a/src/partition/repart.c b/src/partition/repart.c index 4e57f977266..e6725ed352f 100644 --- a/src/partition/repart.c +++ b/src/partition/repart.c @@ -4139,7 +4139,7 @@ static int sign_verity_roothash( static int partition_format_verity_sig(Context *context, Partition *p) { _cleanup_(json_variant_unrefp) JsonVariant *v = NULL; - _cleanup_(iovec_done) struct iovec sig = IOVEC_NULL; + _cleanup_(iovec_done) struct iovec sig = {}; _cleanup_free_ char *text = NULL, *hint = NULL; Partition *hp; uint8_t fp[X509_FINGERPRINT_SIZE];