]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
basic/iovec-util: drop IOVEC_NULL
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 23 Oct 2023 12:59:17 +0000 (14:59 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 23 Oct 2023 13:04:08 +0000 (15:04 +0200)
The macro isn't very useful, we can just use the direct setting to increase
readability.

src/basic/iovec-util.h
src/libsystemd/sd-journal/journal-send.c
src/partition/repart.c

index 9c3134592edf8031aaa11f1441ce79f7ad9520a1..ad6e1275d5113d187a383e24baf299b33d4a8932 100644 (file)
@@ -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 */
index 1ca721e6c94fed820f087d4672da859219e0cc4d..be23b2fe75d631f03f032f984ba2f5eb0e020049 100644 (file)
@@ -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;
 }
index 4e57f977266cbaea66af6d2cc4b3f956dff86df2..e6725ed352f3e8e40b5a9be4ac7a0f5bdaaf74de 100644 (file)
@@ -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];