[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 04/19] qtest: Fix bad printf format specifiers
From: |
Thomas Huth |
Subject: |
[PULL 04/19] qtest: Fix bad printf format specifiers |
Date: |
Tue, 10 Nov 2020 12:11:17 +0100 |
From: AlexChen <alex.chen@huawei.com>
We should use printf format specifier "%u" instead of "%d" for
argument of type "unsigned int".
Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Alex Chen <alex.chen@huawei.com>
Message-Id: <5FA28117.3020802@huawei.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/qtest/arm-cpu-features.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tests/qtest/arm-cpu-features.c b/tests/qtest/arm-cpu-features.c
index d20094d5a7..bc681a95d5 100644
--- a/tests/qtest/arm-cpu-features.c
+++ b/tests/qtest/arm-cpu-features.c
@@ -536,7 +536,7 @@ static void test_query_cpu_model_expansion_kvm(const void
*data)
if (kvm_supports_sve) {
g_assert(vls != 0);
max_vq = 64 - __builtin_clzll(vls);
- sprintf(max_name, "sve%d", max_vq * 128);
+ sprintf(max_name, "sve%u", max_vq * 128);
/* Enabling a supported length is of course fine. */
assert_sve_vls(qts, "host", vls, "{ %s: true }", max_name);
@@ -556,7 +556,7 @@ static void test_query_cpu_model_expansion_kvm(const void
*data)
* unless all larger, supported vector lengths are also
* disabled.
*/
- sprintf(name, "sve%d", vq * 128);
+ sprintf(name, "sve%u", vq * 128);
error = g_strdup_printf("cannot disable %s", name);
assert_error(qts, "host", error,
"{ %s: true, %s: false }",
@@ -569,7 +569,7 @@ static void test_query_cpu_model_expansion_kvm(const void
*data)
* we need at least one vector length enabled.
*/
vq = __builtin_ffsll(vls);
- sprintf(name, "sve%d", vq * 128);
+ sprintf(name, "sve%u", vq * 128);
error = g_strdup_printf("cannot disable %s", name);
assert_error(qts, "host", error, "{ %s: false }", name);
g_free(error);
@@ -581,7 +581,7 @@ static void test_query_cpu_model_expansion_kvm(const void
*data)
}
}
if (vq <= SVE_MAX_VQ) {
- sprintf(name, "sve%d", vq * 128);
+ sprintf(name, "sve%u", vq * 128);
error = g_strdup_printf("cannot enable %s", name);
assert_error(qts, "host", error, "{ %s: true }", name);
g_free(error);
--
2.18.4
- [PULL 00/19] qtests, gitlab, s390x and misc patches, Thomas Huth, 2020/11/10
- [PULL 01/19] meson: always include contrib/libvhost-user, Thomas Huth, 2020/11/10
- [PULL 03/19] device-crash-test: Check if path is actually an executable file, Thomas Huth, 2020/11/10
- [PULL 04/19] qtest: Fix bad printf format specifiers,
Thomas Huth <=
- [PULL 05/19] tests/qtest/tpm: Remove redundant check in the tpm_test_swtpm_test(), Thomas Huth, 2020/11/10
- [PULL 02/19] tests/vm: update openbsd to release 6.8, Thomas Huth, 2020/11/10
- [PULL 06/19] gitlab-ci: Drop generic cache rule, Thomas Huth, 2020/11/10
- [PULL 07/19] MAINTAINERS: Add gitlab-pipeline-status script to GitLab CI section, Thomas Huth, 2020/11/10
- [PULL 11/19] fuzz: Make fork_fuzz.ld compatible with LLVM's LLD, Thomas Huth, 2020/11/10
- [PULL 10/19] scripts/oss-fuzz: give all fuzzers -target names, Thomas Huth, 2020/11/10
- [PULL 09/19] docs/fuzz: update fuzzing documentation post-meson, Thomas Huth, 2020/11/10
- [PULL 12/19] configure: surface deprecated targets in the help output, Thomas Huth, 2020/11/10
- [PULL 13/19] gitlab: publish the docs built during CI, Thomas Huth, 2020/11/10
- [PULL 14/19] gitlab: force enable docs build in Fedora, Ubuntu, Debian, Thomas Huth, 2020/11/10