[LTP] [PATCH 1/2] [RFC] macros: Remove TEST_VOID()

Petr Vorel pvorel@suse.cz
Tue Jan 14 17:20:28 CET 2025


> Hi!

> I'm kinda surprised something so ugly even existed :-) Thanks for cleaning
> up.
> Feel free to merge the whole patch-set.

Yeah, there are many dark sides in LTP :). Fortunately, thanks to you and others
it's getting much better.

Kind regards,
Petr

> Reviewed-by: Andrea Cervesato <andrea.cervesato@suse.com>

> Andrea

> On 1/9/25 14:23, Petr Vorel wrote:
> > TEST_VOID() macro was meant for syscalls whose return type is void, e.g.
> > sync(). It was used only sync03.c, which was later merged to sync01.c
> > and later removed. Now it's unused, therefore remove it.

> > Signed-off-by: Petr Vorel <pvorel@suse.cz>
> > ---
> >   include/old/usctest.h     | 14 --------------
> >   include/tst_test_macros.h |  7 -------
> >   2 files changed, 21 deletions(-)

> > diff --git a/include/old/usctest.h b/include/old/usctest.h
> > index 2d46c40451..b984c343fd 100644
> > --- a/include/old/usctest.h
> > +++ b/include/old/usctest.h
> > @@ -60,20 +60,6 @@ extern int TEST_ERRNO;
> >   		TEST_ERRNO = errno; \
> >   	} while (0)
> > -/***********************************************************************
> > - * TEST_VOID: calls a system call
> > - *
> > - * parameters:
> > - *	SCALL = system call and parameters to execute
> > - *
> > - * Note: This is IDENTICAL to the TEST() macro except that it is intended
> > - * for use with syscalls returning no values (void syscall()).  The
> > - * Typecasting nothing (void) into an unsigned integer causes compilation
> > - * errors.
> > - *
> > - ***********************************************************************/
> > -#define TEST_VOID(SCALL) do { errno = 0; SCALL; TEST_ERRNO = errno; } while (0)
> > -
> >   /***********************************************************************
> >    * TEST_PAUSE: Pause for SIGUSR1 if the pause flag is set.
> >    *	       Just continue when signal comes in.
> > diff --git a/include/tst_test_macros.h b/include/tst_test_macros.h
> > index b2ca32f771..b2b446b70c 100644
> > --- a/include/tst_test_macros.h
> > +++ b/include/tst_test_macros.h
> > @@ -16,13 +16,6 @@
> >   		TST_ERR = errno; \
> >   	} while (0)
> > -#define TEST_VOID(SCALL) \
> > -	do { \
> > -		errno = 0; \
> > -		SCALL; \
> > -		TST_ERR = errno; \
> > -	} while (0)
> > -
> >   extern long TST_RET;
> >   extern int TST_ERR;
> >   extern int TST_PASS;


More information about the ltp mailing list