aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Herrmann <andreas.herrmann@caviumnetworks.com>2014-05-28 22:08:45 +0200
committerWill Deacon <will.deacon@arm.com>2015-06-01 16:39:55 +0100
commit69f50425bd17e458c17942fa4189020dd309cd7b (patch)
tree72907226f7124f86ef3d45291a870e247f328c9a
parent81404cdb952f0b759fd45568373506ee039b807f (diff)
downloadkvmtool-69f50425bd17e458c17942fa4189020dd309cd7b.tar.gz
kvm tools: Fix print format warnings
This should fix following warnings builtin-stat.c:93:3: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 2 has type '__u64' [-Wformat] builtin-run.c:188:4: warning: format '%Lu' expects argument of type 'long long unsigned int', but argument 3 has type '__u64' [-Wformat] builtin-run.c:554:3: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 2 has type 'u64' [-Wformat] builtin-run.c:554:3: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'u64' [-Wformat] builtin-run.c:645:3: warning: format '%Lu' expects argument of type 'long long unsigned int', but argument 4 has type 'u64' [-Wformat] disk/core.c:330:4: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type '__dev_t' [-Wformat] disk/core.c:330:4: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 5 has type '__dev_t' [-Wformat] disk/core.c:330:4: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 6 has type '__ino64_t' [-Wformat] mmio.c:134:5: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'u64' [-Wformat] util/util.c:101:7: warning: format '%lld' expects argument of type 'long long int', but argument 3 has type 'u64' [-Wformat] util/util.c:113:7: warning: format '%lld' expects argument of type 'long long int', but argument 2 has type 'u64' [-Wformat] hw/pci-shmem.c:339:3: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 2 has type 'u64' [-Wformat] hw/pci-shmem.c:340:3: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 2 has type 'u64' [-Wformat] as observed when compiling on mips64. Signed-off-by: Andreas Herrmann <andreas.herrmann@caviumnetworks.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
-rw-r--r--builtin-run.c12
-rw-r--r--builtin-stat.c2
-rw-r--r--disk/core.c4
-rw-r--r--hw/pci-shmem.c5
-rw-r--r--mmio.c5
-rw-r--r--util/util.c4
6 files changed, 20 insertions, 12 deletions
diff --git a/builtin-run.c b/builtin-run.c
index da95d71f..1ee75ad3 100644
--- a/builtin-run.c
+++ b/builtin-run.c
@@ -184,8 +184,8 @@ panic_kvm:
current_kvm_cpu->kvm_run->exit_reason,
kvm_exit_reasons[current_kvm_cpu->kvm_run->exit_reason]);
if (current_kvm_cpu->kvm_run->exit_reason == KVM_EXIT_UNKNOWN)
- fprintf(stderr, "KVM exit code: 0x%Lu\n",
- current_kvm_cpu->kvm_run->hw.hardware_exit_reason);
+ fprintf(stderr, "KVM exit code: 0x%llu\n",
+ (unsigned long long)current_kvm_cpu->kvm_run->hw.hardware_exit_reason);
kvm_cpu__set_debug_fd(STDOUT_FILENO);
kvm_cpu__show_registers(current_kvm_cpu);
@@ -551,7 +551,9 @@ static struct kvm *kvm_cmd_run_init(int argc, const char **argv)
kvm->cfg.ram_size = get_ram_size(kvm->cfg.nrcpus);
if (kvm->cfg.ram_size > host_ram_size())
- pr_warning("Guest memory size %lluMB exceeds host physical RAM size %lluMB", kvm->cfg.ram_size, host_ram_size());
+ pr_warning("Guest memory size %lluMB exceeds host physical RAM size %lluMB",
+ (unsigned long long)kvm->cfg.ram_size,
+ (unsigned long long)host_ram_size());
kvm->cfg.ram_size <<= MB_SHIFT;
@@ -639,7 +641,9 @@ static struct kvm *kvm_cmd_run_init(int argc, const char **argv)
kvm->cfg.real_cmdline = real_cmdline;
printf(" # %s run -k %s -m %Lu -c %d --name %s\n", KVM_BINARY_NAME,
- kvm->cfg.kernel_filename, kvm->cfg.ram_size / 1024 / 1024, kvm->cfg.nrcpus, kvm->cfg.guest_name);
+ kvm->cfg.kernel_filename,
+ (unsigned long long)kvm->cfg.ram_size / 1024 / 1024,
+ kvm->cfg.nrcpus, kvm->cfg.guest_name);
if (init_list__init(kvm) < 0)
die ("Initialisation failed");
diff --git a/builtin-stat.c b/builtin-stat.c
index ffd72e80..5d6407e6 100644
--- a/builtin-stat.c
+++ b/builtin-stat.c
@@ -90,7 +90,7 @@ static int do_memstat(const char *name, int sock)
printf("The total amount of memory available (in bytes):");
break;
}
- printf("%llu\n", stats[i].val);
+ printf("%llu\n", (unsigned long long)stats[i].val);
}
printf("\n");
diff --git a/disk/core.c b/disk/core.c
index 4e9bda01..309e16ce 100644
--- a/disk/core.c
+++ b/disk/core.c
@@ -327,7 +327,9 @@ ssize_t disk_image__get_serial(struct disk_image *disk, void *buffer, ssize_t *l
return r;
*len = snprintf(buffer, *len, "%llu%llu%llu",
- (u64)st.st_dev, (u64)st.st_rdev, (u64)st.st_ino);
+ (unsigned long long)st.st_dev,
+ (unsigned long long)st.st_rdev,
+ (unsigned long long)st.st_ino);
return *len;
}
diff --git a/hw/pci-shmem.c b/hw/pci-shmem.c
index 457e960c..a1c5ab71 100644
--- a/hw/pci-shmem.c
+++ b/hw/pci-shmem.c
@@ -336,8 +336,9 @@ int shmem_parser(const struct option *opt, const char *arg, int unset)
strcpy(handle, default_handle);
}
if (verbose) {
- pr_info("shmem: phys_addr = %llx", phys_addr);
- pr_info("shmem: size = %llx", size);
+ pr_info("shmem: phys_addr = %llx",
+ (unsigned long long)phys_addr);
+ pr_info("shmem: size = %llx", (unsigned long long)size);
pr_info("shmem: handle = %s", handle);
pr_info("shmem: create = %d", create);
}
diff --git a/mmio.c b/mmio.c
index 705ce27f..c648becc 100644
--- a/mmio.c
+++ b/mmio.c
@@ -131,8 +131,9 @@ bool kvm__emulate_mmio(struct kvm_cpu *vcpu, u64 phys_addr, u8 *data, u32 len, u
mmio->mmio_fn(vcpu, phys_addr, data, len, is_write, mmio->ptr);
else {
if (vcpu->kvm->cfg.mmio_debug)
- fprintf(stderr, "Warning: Ignoring MMIO %s at %016llx (length %u)\n",
- to_direction(is_write), phys_addr, len);
+ fprintf(stderr, "Warning: Ignoring MMIO %s at %016llx (length %u)\n",
+ to_direction(is_write),
+ (unsigned long long)phys_addr, len);
}
br_read_unlock();
diff --git a/util/util.c b/util/util.c
index c11a15a3..1877105e 100644
--- a/util/util.c
+++ b/util/util.c
@@ -98,7 +98,7 @@ void *mmap_hugetlbfs(struct kvm *kvm, const char *htlbfs_path, u64 size)
blk_size = (unsigned long)sfs.f_bsize;
if (sfs.f_bsize == 0 || blk_size > size) {
die("Can't use hugetlbfs pagesize %ld for mem size %lld\n",
- blk_size, size);
+ blk_size, (unsigned long long)size);
}
kvm->ram_pagesize = blk_size;
@@ -110,7 +110,7 @@ void *mmap_hugetlbfs(struct kvm *kvm, const char *htlbfs_path, u64 size)
unlink(mpath);
if (ftruncate(fd, size) < 0)
die("Can't ftruncate for mem mapping size %lld\n",
- size);
+ (unsigned long long)size);
addr = mmap(NULL, size, PROT_RW, MAP_PRIVATE, fd, 0);
close(fd);