summaryrefslogtreecommitdiff
path: root/mkfs.c
diff options
context:
space:
mode:
authorWade Cline <clinew@linux.vnet.ibm.com>2012-09-20 14:26:28 -0700
committerDavid Sterba <dsterba@suse.cz>2013-01-17 18:12:57 +0100
commit0d5cfddc2c8c34648ff21d99a1e34aae92ff25d0 (patch)
treee3a46250fc213e97da9292995983068fd9581961 /mkfs.c
parent91d9eec1ff044394f2b98ee7fcb76713dd33b994 (diff)
Btrfs-progs: Fix compiler warnings on PPC64
The kernel uses unsigned long long for u64, but PPC64 uses unsigned long by default. This results in compilation warnings such as: print-tree.c:333: warning: format '%llu' expects type 'long long unsigned int', but argument 4 has type 'u64' To fix this, the macro __KERNEL__ needs to be defined before including the file <asm/types.h>. This can be done by defining the macro in "kerncompat.h" and making it the first included file in the relevant header files; this fixes the compiler warnings on PPC64. Reviewed-by: David Sterba <dsterba@suse.cz> Signed-off-by: Wade Cline <clinew@linux.vnet.ibm.com>
Diffstat (limited to 'mkfs.c')
-rw-r--r--mkfs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mkfs.c b/mkfs.c
index 47f0c9ca..8fda48a8 100644
--- a/mkfs.c
+++ b/mkfs.c
@@ -19,6 +19,8 @@
#define _XOPEN_SOURCE 500
#define _GNU_SOURCE
+#include "kerncompat.h"
+
#ifndef __CHECKER__
#include <sys/ioctl.h>
#include <sys/mount.h>
@@ -37,7 +39,6 @@
#include <linux/fs.h>
#include <ctype.h>
#include <attr/xattr.h>
-#include "kerncompat.h"
#include "ctree.h"
#include "disk-io.h"
#include "volumes.h"