On Thu, May 28, 2026 at 06:13:16AM -0700, Sean Christopherson wrote:
> On Thu, May 28, 2026, Piotr Zarycki wrote:
> > Replace the open-coded swap with the swap() macro.
> >
> > Signed-off-by: Piotr Zarycki <[email protected]>
> > ---
> > tools/testing/selftests/kvm/include/test_util.h | 2 ++
> > tools/testing/selftests/kvm/x86/hyperv_tlb_flush.c | 6 +-----
> > 2 files changed, 3 insertions(+), 5 deletions(-)
> >
> > diff --git a/tools/testing/selftests/kvm/include/test_util.h
> > b/tools/testing/selftests/kvm/include/test_util.h
> > index d9b433b834f1..a66bc9ccba65 100644
> > --- a/tools/testing/selftests/kvm/include/test_util.h
> > +++ b/tools/testing/selftests/kvm/include/test_util.h
> > @@ -26,6 +26,8 @@
> >
> > #define msecs_to_usecs(msec) ((msec) * 1000ULL)
> >
> > +#define swap(a, b) do { typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; }
> > while (0)
>
> This belongs in a common tools/ header, not in KVM's test_util.h. I don't see
> an obvious place, maybe tools/include/linux/kernel.h?
Good point, v2 below.