diff mbox series

tests: Fix printf format string in acpi-utils.c

Message ID 20231027030930.7739-1-zhujun2@cmss.chinamobile.com
State New
Headers show
Series tests: Fix printf format string in acpi-utils.c | expand

Commit Message

Zhu Jun Oct. 27, 2023, 3:09 a.m. UTC
Inside of acpi_fetch_table() arguments are
printed via fprintf but '%d' is used to print @flags (of type
uint). Use '%u' instead.

Signed-off-by: zhujun2 <zhujun2@cmss.chinamobile.com>
---
 tests/qtest/acpi-utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Markus Armbruster Oct. 27, 2023, 1:32 p.m. UTC | #1
zhujun2 <zhujun2@cmss.chinamobile.com> writes:

> Inside of acpi_fetch_table() arguments are
> printed via fprintf but '%d' is used to print @flags (of type
> uint). Use '%u' instead.
>
> Signed-off-by: zhujun2 <zhujun2@cmss.chinamobile.com>

Please sign off with your real name.

You should be able to automate this by putting

    [user]
            email = armbru@redhat.com
            name = Markus Armbruster

into ~/.gitconfig or git/config.
Michael S. Tsirkin Nov. 6, 2023, 5:40 p.m. UTC | #2
On Thu, Oct 26, 2023 at 08:09:30PM -0700, zhujun2 wrote:
> Inside of acpi_fetch_table() arguments are
> printed via fprintf but '%d' is used to print @flags (of type
> uint). Use '%u' instead.
> 
> Signed-off-by: zhujun2 <zhujun2@cmss.chinamobile.com>

OK though I never expect this to matter.

> ---
>  tests/qtest/acpi-utils.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/qtest/acpi-utils.c b/tests/qtest/acpi-utils.c
> index 673fc97586..6389f1f418 100644
> --- a/tests/qtest/acpi-utils.c
> +++ b/tests/qtest/acpi-utils.c
> @@ -102,7 +102,7 @@ void acpi_fetch_table(QTestState *qts, uint8_t **aml, uint32_t *aml_len,
>              char *fname = NULL;
>              GError *error = NULL;
>  
> -            fprintf(stderr, "Invalid '%.4s'(%d)\n", *aml, *aml_len);
> +            fprintf(stderr, "Invalid '%.4s'(%u)\n", *aml, *aml_len);
>              fd = g_file_open_tmp("malformed-XXXXXX.dat", &fname, &error);
>              g_assert_no_error(error);
>              fprintf(stderr, "Dumping invalid table into '%s'\n", fname);
> -- 
> 2.17.1
> 
>
diff mbox series

Patch

diff --git a/tests/qtest/acpi-utils.c b/tests/qtest/acpi-utils.c
index 673fc97586..6389f1f418 100644
--- a/tests/qtest/acpi-utils.c
+++ b/tests/qtest/acpi-utils.c
@@ -102,7 +102,7 @@  void acpi_fetch_table(QTestState *qts, uint8_t **aml, uint32_t *aml_len,
             char *fname = NULL;
             GError *error = NULL;
 
-            fprintf(stderr, "Invalid '%.4s'(%d)\n", *aml, *aml_len);
+            fprintf(stderr, "Invalid '%.4s'(%u)\n", *aml, *aml_len);
             fd = g_file_open_tmp("malformed-XXXXXX.dat", &fname, &error);
             g_assert_no_error(error);
             fprintf(stderr, "Dumping invalid table into '%s'\n", fname);