[Ocfs2-tools-devel] [PATCH 6/7] tunefs: Suppress build warnings

Sunil Mushran sunil.mushran at oracle.com
Tue Jun 3 14:46:43 PDT 2008


From: Tao Ma <tao.ma at oracle.com>

This patch silences the following warning:
tunefs.c:651: warning: format ‘%lu’ expects type ‘long unsigned int’, but argument 5 has type ‘__u64

This patch silences the build warning by casting the argument as uint64_t.

Signed-off-by: Tao Ma <tao.ma at oracle.com>
Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com>
---
 tunefs.ocfs2/resize.c      |    4 ++--
 tunefs.ocfs2/sparse_file.c |    2 +-
 tunefs.ocfs2/tunefs.c      |   12 ++++++------
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/tunefs.ocfs2/resize.c b/tunefs.ocfs2/resize.c
index 72aff96..6dc6851 100644
--- a/tunefs.ocfs2/resize.c
+++ b/tunefs.ocfs2/resize.c
@@ -397,7 +397,7 @@ static errcode_t update_global_bitmap(ocfs2_filesys *fs,
 		if (ret) {
 			com_err(opts.progname, ret, "while flushing group "
 				"descriptor at block %"PRIu64" during "
-				"volume resize", lgd->bg_blkno);
+				"volume resize", (uint64_t)lgd->bg_blkno);
 			goto bail;
 		}
 	}
@@ -407,7 +407,7 @@ static errcode_t update_global_bitmap(ocfs2_filesys *fs,
 	if (ret) {
 		com_err(opts.progname, ret, "while writing global bitmap "
 			"inode at block %"PRIu64" during volume resize",
-			di->i_blkno);
+			(uint64_t)di->i_blkno);
 	}
 
 bail:
diff --git a/tunefs.ocfs2/sparse_file.c b/tunefs.ocfs2/sparse_file.c
index f0eedb3..e068524 100644
--- a/tunefs.ocfs2/sparse_file.c
+++ b/tunefs.ocfs2/sparse_file.c
@@ -329,7 +329,7 @@ static errcode_t list_sparse_file(ocfs2_filesys *fs,
 
 print:
 	if (ctxt->file_hole_len > 0)
-		printf("%"PRIu64"\t%u\t\t%s\n", di->i_blkno,
+		printf("%"PRIu64"\t%u\t\t%s\n", (uint64_t)di->i_blkno,
 			ctxt->file_hole_len, ctxt->file_name);
 
 bail:
diff --git a/tunefs.ocfs2/tunefs.c b/tunefs.ocfs2/tunefs.c
index ff917da..be10eb2 100644
--- a/tunefs.ocfs2/tunefs.c
+++ b/tunefs.ocfs2/tunefs.c
@@ -648,7 +648,7 @@ static errcode_t validate_chain_group(ocfs2_filesys *fs, struct ocfs2_dinode *di
 			ret = OCFS2_ET_CORRUPT_CHAIN;
 			com_err(opts.progname, ret, " - group descriptor at "
 				"%"PRIu64" does not belong to allocator %"PRIu64"",
-				blkno, di->i_blkno);
+				blkno, (uint64_t)di->i_blkno);
 			goto bail;
 		}
 
@@ -657,7 +657,7 @@ static errcode_t validate_chain_group(ocfs2_filesys *fs, struct ocfs2_dinode *di
 			com_err(opts.progname, ret, " - group descriptor at "
 				"%"PRIu64" does not agree to the chain it "
 				"belongs to in allocator %"PRIu64"",
-				blkno, di->i_blkno);
+				blkno, (uint64_t)di->i_blkno);
 			goto bail;
 		}
 
@@ -666,7 +666,7 @@ static errcode_t validate_chain_group(ocfs2_filesys *fs, struct ocfs2_dinode *di
 			ret = OCFS2_ET_CORRUPT_CHAIN;
 			com_err(opts.progname, ret, " - group descriptor at "
 				"%"PRIu64" does not have a consistent free "
-				"bit count", blkno);
+				"bit count", (uint64_t)blkno);
 			goto bail;
 		}
 
@@ -674,7 +674,7 @@ static errcode_t validate_chain_group(ocfs2_filesys *fs, struct ocfs2_dinode *di
 			ret = OCFS2_ET_CORRUPT_CHAIN;
 			com_err(opts.progname, ret, " - group descriptor at "
 				"%"PRIu64" does not have a valid total bit "
-				"count", blkno);
+				"count", (uint64_t)blkno);
 			goto bail;
 		}
 
@@ -695,7 +695,7 @@ static errcode_t validate_chain_group(ocfs2_filesys *fs, struct ocfs2_dinode *di
 		ret = OCFS2_ET_CORRUPT_CHAIN;
 		com_err(opts.progname, ret, " - total bits for chain %u in "
 			"allocator %"PRIu64" does not match its chained group "
-			"descriptors", chain, di->i_blkno);
+			"descriptors", chain, (uint64_t)di->i_blkno);
 		goto bail;
 
 	}
@@ -704,7 +704,7 @@ static errcode_t validate_chain_group(ocfs2_filesys *fs, struct ocfs2_dinode *di
 		ret = OCFS2_ET_CORRUPT_CHAIN;
 		com_err(opts.progname, ret, " - free bits for chain %u in "
 			"allocator %"PRIu64" does not match its chained group "
-			"descriptors", chain, di->i_blkno);
+			"descriptors", chain, (uint64_t)di->i_blkno);
 		goto bail;
 	}
 
-- 
1.5.3.6




More information about the Ocfs2-tools-devel mailing list