[LTP] [PATCH 2/3] fanotify20: Simplify code
Amir Goldstein
amir73il@gmail.com
Tue Sep 6 11:55:11 CEST 2022
On Tue, Sep 6, 2022 at 12:26 PM Petr Vorel <pvorel@suse.cz> wrote:
>
> * replace do_test() content with TST_EXP_FD_ERRNO() macro
> * rename variables (shorten, use LTP common names)
> * remove tc->want_err (not needed)
> * add macro FLAGS_DESC (stringify)
> * don't print number of tests (not needed for just 2 tests)
>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
Nice cleanup.
You may add
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
however...
> ---
> .../kernel/syscalls/fanotify/fanotify20.c | 81 +++++--------------
> 1 file changed, 19 insertions(+), 62 deletions(-)
>
> diff --git a/testcases/kernel/syscalls/fanotify/fanotify20.c b/testcases/kernel/syscalls/fanotify/fanotify20.c
> index de0fdb782..badc4c369 100644
> --- a/testcases/kernel/syscalls/fanotify/fanotify20.c
> +++ b/testcases/kernel/syscalls/fanotify/fanotify20.c
> @@ -1,6 +1,7 @@
> // SPDX-License-Identifier: GPL-2.0-or-later
> /*
> * Copyright (c) 2021 Google. All Rights Reserved.
> + * Copyright (c) 2022 Petr Vorel <pvorel@suse.cz>
> *
> * Started by Matthew Bobrowski <repnop@google.com>
> */
> @@ -25,26 +26,21 @@
> #include "fanotify.h"
>
> #define MOUNT_PATH "fs_mnt"
> +#define FLAGS_DESC(x) .flags = x, .desc = #x
>
> -static int fanotify_fd;
> +static int fd;
>
What is this change for?
It makes the code less readable.
fd is quite an unspecific name for a global variable.
Thanks,
Amir.
More information about the ltp
mailing list