summaryrefslogtreecommitdiff
path: root/util/inteltool/pcie.c
diff options
context:
space:
mode:
authorStefan Reinauer <reinauer@chromium.org>2011-11-14 12:40:34 -0800
committerStefan Reinauer <stefan.reinauer@coreboot.org>2012-03-30 20:26:50 +0200
commita7b296d450c5d948b95c1342f726334b4e5a4c68 (patch)
tree2e4939509d1ba3f74fd460a152cfa84c2b4b96f5 /util/inteltool/pcie.c
parent8acbc2a8865ca74f0f80c51c6511b9ab4c03d552 (diff)
Fix warnings in coreboot utilities.
- Fix some poor programming practice (breaks of strict aliasing as well as not checking the return value of read) - Use PRIx64 instead of %llx to prevent compilation warnings with both 32bit and 64bit compilers - Use same compiler command options when linking inteltool and when detecting libpci for inteltool Change-Id: I08b2e8d1bbc908f6b1f26d25cb3a4b03d818e124 Signed-off-by: Stefan Reinauer <reinauer@google.com> Reviewed-on: http://review.coreboot.org/752 Tested-by: build bot (Jenkins) Reviewed-by: Mathias Krause <minipli@googlemail.com>
Diffstat (limited to 'util/inteltool/pcie.c')
-rw-r--r--util/inteltool/pcie.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/util/inteltool/pcie.c b/util/inteltool/pcie.c
index 4913150943..ea23835425 100644
--- a/util/inteltool/pcie.c
+++ b/util/inteltool/pcie.c
@@ -19,6 +19,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <inttypes.h>
#include "inteltool.h"
/*
@@ -72,7 +73,7 @@ int print_epbar(struct pci_dev *nb)
exit(1);
}
- printf("EPBAR = 0x%08llx (MEM)\n\n", epbar_phys);
+ printf("EPBAR = 0x%08" PRIx64 " (MEM)\n\n", epbar_phys);
for (i = 0; i < size; i += 4) {
if (*(uint32_t *)(epbar + i))
printf("0x%04x: 0x%08x\n", i, *(uint32_t *)(epbar+i));
@@ -135,7 +136,7 @@ int print_dmibar(struct pci_dev *nb)
exit(1);
}
- printf("DMIBAR = 0x%08llx (MEM)\n\n", dmibar_phys);
+ printf("DMIBAR = 0x%08" PRIx64 " (MEM)\n\n", dmibar_phys);
for (i = 0; i < size; i += 4) {
if (*(uint32_t *)(dmibar + i))
printf("0x%04x: 0x%08x\n", i, *(uint32_t *)(dmibar+i));
@@ -213,7 +214,7 @@ int print_pciexbar(struct pci_dev *nb)
return 1;
}
- printf("PCIEXBAR: 0x%08llx\n", pciexbar_phys);
+ printf("PCIEXBAR: 0x%08" PRIx64 "\n", pciexbar_phys);
pciexbar = map_physical(pciexbar_phys, (max_busses * 1024 * 1024));