From: Xiao Ni Date: Wed, 7 May 2025 10:26:08 +0000 (+0800) Subject: mdadm: fix building errors X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f815615ebf74a71064ba480ba773ef4bf98b53b0;p=thirdparty%2Fmdadm.git mdadm: fix building errors 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 --- diff --git a/super-ddf.c b/super-ddf.c index 6e7db924..dda8b7fe 100644 --- a/super-ddf.c +++ b/super-ddf.c @@ -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); diff --git a/super-intel.c b/super-intel.c index b7b030a2..4fbbc98d 100644 --- a/super-intel.c +++ b/super-intel.c @@ -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,