]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
mdadm: fix building errors
authorXiao Ni <xni@redhat.com>
Wed, 7 May 2025 10:26:08 +0000 (18:26 +0800)
committerXiaoNi87 <xni@redhat.com>
Thu, 8 May 2025 15:30:38 +0000 (23:30 +0800)
Some building errors are found in ppc64le platform:
format '%llu' expects argument of type 'long long unsigned int', but
argument 3 has type 'long unsigned int' [-Werror=format=]

Signed-off-by: Xiao Ni <xni@redhat.com>
super-ddf.c
super-intel.c

index 6e7db924d2b1bcc30b6d90a5c0cb8f3e0032147b..dda8b7fedd64bc834255a509714590d7d577e46e 100644 (file)
@@ -1606,9 +1606,9 @@ static void examine_vd(int n, struct ddf_super *sb, char *guid)
                               map_num(ddf_sec_level, vc->srl) ?: "-unknown-");
                }
                printf("  Device Size[%d] : %llu\n", n,
-                      be64_to_cpu(vc->blocks)/2);
+                      (unsigned long long)(be64_to_cpu(vc->blocks)/2));
                printf("   Array Size[%d] : %llu\n", n,
-                      be64_to_cpu(vc->array_blocks)/2);
+                      (unsigned long long)(be64_to_cpu(vc->array_blocks)/2));
        }
 }
 
@@ -1665,7 +1665,7 @@ static void examine_pds(struct ddf_super *sb)
                printf("       %3d    %08x  ", i,
                       be32_to_cpu(pd->refnum));
                printf("%8lluK ",
-                      be64_to_cpu(pd->config_size)>>1);
+                               (unsigned long long)be64_to_cpu(pd->config_size)>>1);
                for (dl = sb->dlist; dl ; dl = dl->next) {
                        if (be32_eq(dl->disk.refnum, pd->refnum)) {
                                char *dv = map_dev(dl->major, dl->minor, 0);
@@ -2901,7 +2901,8 @@ static unsigned int find_unused_pde(const struct ddf_super *ddf)
 static void _set_config_size(struct phys_disk_entry *pde, const struct dl *dl)
 {
        __u64 cfs, t;
-       cfs = min(dl->size - 32*1024*2ULL, be64_to_cpu(dl->primary_lba));
+       cfs = min((unsigned long long)dl->size - 32*1024*2ULL,
+                       (unsigned long long)(be64_to_cpu(dl->primary_lba)));
        t = be64_to_cpu(dl->secondary_lba);
        if (t != ~(__u64)0)
                cfs = min(cfs, t);
index b7b030a204325fe2800c32bceda88ca4da1b2bb5..4fbbc98d915c0e3defa2977e0c49a3fcdc9f1601 100644 (file)
@@ -2325,7 +2325,8 @@ static void export_examine_super_imsm(struct supertype *st)
        printf("MD_LEVEL=container\n");
        printf("MD_UUID=%s\n", nbuf+5);
        printf("MD_DEVICES=%u\n", mpb->num_disks);
-       printf("MD_CREATION_TIME=%llu\n", __le64_to_cpu(mpb->creation_time));
+       printf("MD_CREATION_TIME=%llu\n",
+                       (unsigned long long)__le64_to_cpu(mpb->creation_time));
 }
 
 static void detail_super_imsm(struct supertype *st, char *homehost,