Re: [PATCH v2 3/3] KVM: selftests: Remove unnecessary "%s" formatting of a constant string

From: Ackerley Tng

Date: Fri May 22 2026 - 14:15:08 EST


Sean Christopherson <seanjc@xxxxxxxxxx> writes:

> Drop superfluous %s formatting from assertions in the guest_memfd overlap
> testcases, as the string being printed doesn't require runtime formatting.
>
> No functional change intended.
>
> Reported-by: Ackerley Tng <ackerleytng@xxxxxxxxxx>
> Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
> ---
> tools/testing/selftests/kvm/set_memory_region_test.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/kvm/set_memory_region_test.c b/tools/testing/selftests/kvm/set_memory_region_test.c
> index be99c1ff5a5a..e0800bfb11eb 100644
> --- a/tools/testing/selftests/kvm/set_memory_region_test.c
> +++ b/tools/testing/selftests/kvm/set_memory_region_test.c
> @@ -554,7 +554,7 @@ static void test_add_overlapping_private_memory_regions(void)
> MEM_REGION_GPA * 2 - MEM_REGION_SIZE,
> MEM_REGION_SIZE * 2,
> 0, memfd, 0);
> - TEST_ASSERT(r == -1 && errno == EEXIST, "%s",
> + TEST_ASSERT(r == -1 && errno == EEXIST,
> "Overlapping guest_memfd() bindings should fail with EEXIST");
>
> /* And now the back half of the other slot. */
> @@ -562,7 +562,7 @@ static void test_add_overlapping_private_memory_regions(void)
> MEM_REGION_GPA * 2 + MEM_REGION_SIZE,
> MEM_REGION_SIZE * 2,
> 0, memfd, 0);
> - TEST_ASSERT(r == -1 && errno == EEXIST, "%s",
> + TEST_ASSERT(r == -1 && errno == EEXIST,
> "Overlapping guest_memfd() bindings should fail with EEXIST");
>
> close(memfd);
> --
> 2.54.0.794.g4f17f83d09-goog

Reviewed-by: Ackerley Tng <ackerleytng@xxxxxxxxxx>

Thanks!