From: alex.bennee@linaro.org (Alex Bennée)
To: linux-arm-kernel@lists.infradead.org
Subject: [kvm-unit-tests PATCH 2/6] lib/pci: fix BAR format strings
Date: Wed, 11 Jan 2017 16:28:37 +0000 [thread overview]
Message-ID: <20170111162841.15569-3-alex.bennee@linaro.org> (raw)
In-Reply-To: <20170111162841.15569-1-alex.bennee@linaro.org>
Using %x as a format string is not portable across 32/64 bit builds.
Use explicit PRIx32 format strings like the 64 bit version above.
Signed-off-by: Alex Benn?e <alex.bennee@linaro.org>
---
lib/pci.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/pci.c b/lib/pci.c
index 6416191..597d8f2 100644
--- a/lib/pci.c
+++ b/lib/pci.c
@@ -67,7 +67,7 @@ bool pci_setup_msi(struct pci_dev *dev, uint64_t msi_addr, uint32_t msi_data)
pci_config_writel(addr, offset + PCI_MSI_DATA_32, msi_data);
printf("MSI: dev 0x%x init 32bit address: ", addr);
}
- printf("addr=0x%lx, data=0x%x\n", msi_addr, msi_data);
+ printf("addr=0x%" PRIx64 ", data=0x%" PRIx32 "\n", msi_addr, msi_data);
msi_control |= PCI_MSI_FLAGS_ENABLE;
pci_config_writew(addr, offset + PCI_MSI_FLAGS, msi_control);
@@ -237,7 +237,7 @@ void pci_bar_print(struct pci_dev *dev, int bar_num)
printf("BAR#%d,%d [%" PRIx64 "-%" PRIx64 " ",
bar_num, bar_num + 1, start, end);
} else {
- printf("BAR#%d [%02x-%02x ",
+ printf("BAR#%d [%" PRIx32 "-%" PRIx32 " ",
bar_num, (uint32_t)start, (uint32_t)end);
}
--
2.11.0
next prev parent reply other threads:[~2017-01-11 16:28 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-11 16:28 [kvm-unit-tests PATCH 0/6] Documentation misc fixes Alex Bennée
2017-01-11 16:28 ` [kvm-unit-tests PATCH 1/6] libcflat: add PRI(dux)32 format types Alex Bennée
2017-01-12 12:29 ` Paolo Bonzini
2017-01-12 12:39 ` Alex Bennée
2017-01-12 16:56 ` Andrew Jones
2017-01-12 17:18 ` Alex Bennée
2017-01-12 17:43 ` Andrew Jones
2017-01-12 17:44 ` Paolo Bonzini
2017-01-12 18:01 ` Alex Bennée
2017-01-13 18:03 ` Andrew Jones
2017-01-11 16:28 ` Alex Bennée [this message]
2017-01-12 12:35 ` [kvm-unit-tests PATCH 2/6] lib/pci: fix BAR format strings Paolo Bonzini
2017-01-11 16:28 ` [kvm-unit-tests PATCH 3/6] docs: move README to README.md and symlink Alex Bennée
2017-01-12 17:04 ` Andrew Jones
2017-01-11 16:28 ` [kvm-unit-tests PATCH 4/6] docs: mention checkpatch in the README Alex Bennée
2017-01-12 12:29 ` Paolo Bonzini
2017-01-12 12:35 ` Alex Bennée
2017-01-12 17:09 ` Andrew Jones
2017-01-12 17:08 ` Andrew Jones
2017-01-11 16:28 ` [kvm-unit-tests PATCH 5/6] docs: mention modifying env vars in README Alex Bennée
2017-01-12 17:14 ` Andrew Jones
2017-01-11 16:28 ` [kvm-unit-tests PATCH 6/6] run_tests: allow passing of options to QEMU Alex Bennée
2017-01-12 12:30 ` Paolo Bonzini
2017-01-12 17:32 ` Andrew Jones
2017-01-12 17:50 ` Paolo Bonzini
2017-01-17 12:07 ` Alex Bennée
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=20170111162841.15569-3-alex.bennee@linaro.org \
--to=alex.bennee@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/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).