]> sourceware.org Git - lvm2.git/commitdiff
clean: use struct initializer
authorZdenek Kabelac <zkabelac@redhat.com>
Wed, 8 May 2024 12:24:21 +0000 (14:24 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Wed, 8 May 2024 14:14:58 +0000 (16:14 +0200)
libdm/dm-tools/dmfilemapd.c
libdm/libdm-stats.c

index 7507c2ca32a51a413269bd124e6fbfe12cc16865..587a18e4c17b6150eb8eed2286960fbc2de8d07c 100644 (file)
@@ -812,9 +812,7 @@ static const char _mode_names[][8] = {
  */
 int main(int argc, char **argv)
 {
-       struct filemap_monitor fm;
-
-       memset(&fm, 0, sizeof(fm));
+       struct filemap_monitor fm = { 0 };
 
        if (!_parse_args(argc, argv, &fm)) {
                free(fm.path);
index a8e0c0103b1daedc71e8f6f3acb4509c87b6319a..703b58a4b0daa226b437ec279b83b2b73c3c791b 100644 (file)
@@ -837,7 +837,7 @@ static int _stats_parse_histogram_spec(struct dm_stats *dms,
        uint64_t scale = region->timescale, this_val = 0;
        struct dm_pool *mem = dms->hist_mem;
        struct dm_histogram_bin cur;
-       struct dm_histogram hist;
+       struct dm_histogram hist = { 0 };
        int nr_bins = 1;
        const char *c, *v, *val_start;
        char *p, *endptr = NULL;
@@ -857,8 +857,6 @@ static int _stats_parse_histogram_spec(struct dm_stats *dms,
        if (!dm_pool_begin_object(mem, sizeof(cur)))
                return_0;
 
-       memset(&hist, 0, sizeof(hist));
-
        hist.nr_bins = 0; /* fix later */
        hist.region = region;
        hist.dms = dms;
This page took 0.055713 seconds and 5 git commands to generate.