linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xiao Ni <xni@redhat.com>
To: linux-raid@vger.kernel.org
Cc: mtkaczyk@kernel.org, ncroxon@redhat.com
Subject: [PATCH 2/3] mdadm: fix building errors
Date: Wed,  7 May 2025 20:20:01 +0800	[thread overview]
Message-ID: <20250507122002.20826-3-xni@redhat.com> (raw)
In-Reply-To: <20250507122002.20826-1-xni@redhat.com>

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   | 9 +++++----
 super-intel.c | 3 ++-
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/super-ddf.c b/super-ddf.c
index 6e7db924d2b1..dda8b7fedd64 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 b7b030a20432..4fbbc98d915c 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,
-- 
2.32.0 (Apple Git-132)


  parent reply	other threads:[~2025-05-07 12:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-07 12:19 [PATCH 0/3] mdadm: minor fixes Xiao Ni
2025-05-07 12:20 ` [PATCH 1/3] mdadm: use standard libc nftw Xiao Ni
2025-05-07 12:20 ` Xiao Ni [this message]
2025-05-07 13:53   ` [PATCH 2/3] mdadm: fix building errors Paul Menzel
2025-05-08  2:53     ` Xiao Ni
2025-05-07 12:20 ` [PATCH 3/3] mdadm: add attribute nonstring for signature Xiao Ni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250507122002.20826-3-xni@redhat.com \
    --to=xni@redhat.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=mtkaczyk@kernel.org \
    --cc=ncroxon@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).