Re: [PATCH v3] selftests: add swap() macro to kselftest.h

From: Piotr Zarycki

Date: Thu Jul 16 2026 - 15:00:05 EST


O Thu, Jul 09, 2026 at 07:55:10AM -0700, Sean Christopherson wrote:
> On Thu, Jun 25, 2026, Piotr Zarycki wrote:
> > Add swap() to tools/testing/selftests/kselftest.h with an #ifndef guard.
> >
> > Guard the local swap() definition in mm/uffd-stress.c with #ifndef to
> > prevent a redefinition warning.
> >
> > Use swap() in hyperv_tlb_flush.c to replace the open-coded PTE swap and
> > remove the TODO comment.
> >
> > Signed-off-by: Piotr Zarycki <piotr.zarycki@xxxxxxxxx>
> > ---
> > Changes in v3:
> > - Add #ifndef guard to mm/uffd-stress.c to fix a redefinition warning;
> > uffd-stress.c defines its own swap() without a guard, which conflicts
> > when kselftest.h is included first via uffd-common.h.
>
> Why not explicitly include kselftest.h in mm/uffd-stress.c and drop uffd-stress.c's
> version of swap()?

Dropped the local definition entirely. Sending v4.