From: sashiko-bot@kernel.org
To: "Piotr Zarycki" <piotr.zarycki@gmail.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH v2] KVM: selftests: hyperv_tlb_flush: use swap() to swap PTEs
Date: Thu, 28 May 2026 16:04:26 +0000 [thread overview]
Message-ID: <20260528160426.DF0DF1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260528154003.3594107-1-piotr.zarycki@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Adding the `swap()` macro to `kselftest.h` introduces a macro redefinition warning in the mm selftests.
--
commit 677f4e84e8344f4b974940d4980c2813e71714b6
Author: Piotr Zarycki <piotr.zarycki@gmail.com>
KVM: selftests: hyperv_tlb_flush: use swap() to swap PTEs
This commit replaces the open-coded variable swapping in the hyperv_tlb_flush
selftest by introducing a swap() macro in the shared kselftest.h header.
> diff --git a/tools/testing/selftests/kselftest.h b/tools/testing/selftests/kselftest.h
> index 60838b61a2da5..7f53751523d89 100644
> --- a/tools/testing/selftests/kselftest.h
> +++ b/tools/testing/selftests/kselftest.h
> @@ -64,6 +64,10 @@
> #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
> #endif
>
> +#ifndef swap
> +#define swap(a, b) do { typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; } while (0)
> +#endif
[Severity: Low]
Does adding this swap() macro to the global kselftest.h header cause a macro
redefinition warning elsewhere in the selftests?
The tools/testing/selftests/mm/uffd-stress.c test includes kselftest.h (via
uffd-common.h) and unconditionally defines its own swap(a, b) macro using
__auto_type. Because this patch adds swap() to the shared kselftest.h header,
compiling uffd-stress.c will now trigger a compiler warning for macro
redefinition.
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260528154003.3594107-1-piotr.zarycki@gmail.com?part=1
prev parent reply other threads:[~2026-05-28 16:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-28 9:45 [PATCH] KVM: selftests: hyperv_tlb_flush: use swap() to swap PTEs Piotr Zarycki
2026-05-28 13:13 ` Sean Christopherson
2026-05-28 14:07 ` Piotr Zarycki
2026-05-28 14:10 ` [PATCH v2] " Piotr Zarycki
2026-05-28 14:35 ` sashiko-bot
2026-05-28 15:35 ` Piotr Zarycki
2026-05-28 16:04 ` sashiko-bot [this message]
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=20260528160426.DF0DF1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=piotr.zarycki@gmail.com \
--cc=sashiko-reviews@lists.linux.dev \
/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