From: Petr Vorel <pvorel@suse.cz>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Matthew Bobrowski <repnop@google.com>, Jan Kara <jack@suse.cz>,
LTP List <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH 2/3] fanotify20: Simplify code
Date: Tue, 6 Sep 2022 17:54:49 +0200 [thread overview]
Message-ID: <YxdtSXUyX6E5S2Ff@pevik> (raw)
In-Reply-To: <CAOQ4uxjiAqFJajosfa5pkN-4=iDOWtiYFvNy7EU1Fd1=trRmMA@mail.gmail.com>
> 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>
Thanks a lot for your time to review.
> 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.
The motivation was: fanotify_fd is quite long and there are quite a lot of long
lines which needs to be split. I also thought that the only file descriptor in
fanotify tests does not have to have "fanotify_" prefix. But sure, No problem, I
merge it without this change.
Kind regards,
Petr
> Thanks,
> Amir.
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2022-09-06 15:55 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-06 9:26 [LTP] [PATCH 0/3] fanotify{14,20}: cleanup Petr Vorel
2022-09-06 9:26 ` [LTP] [PATCH 1/3] tst_test_macros: Add TST_EXP_FD_ERRNO Petr Vorel
2022-09-06 9:26 ` [LTP] [PATCH 2/3] fanotify20: Simplify code Petr Vorel
2022-09-06 9:55 ` Amir Goldstein
2022-09-06 15:54 ` Petr Vorel [this message]
2022-09-06 16:14 ` Petr Vorel
2022-09-07 7:05 ` Matthew Bobrowski via ltp
2022-09-07 10:49 ` Petr Vorel
2022-09-06 9:26 ` [LTP] [PATCH 3/3] fanotify14: Use TST_EXP_FD_ERRNO() Petr Vorel
2022-09-06 10:13 ` Amir Goldstein
2022-09-06 15:56 ` Petr Vorel
2022-09-07 7:17 ` Matthew Bobrowski via ltp
2022-09-07 7:24 ` [LTP] [PATCH 0/3] fanotify{14,20}: cleanup Matthew Bobrowski via ltp
2022-09-07 11:05 ` Petr Vorel
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=YxdtSXUyX6E5S2Ff@pevik \
--to=pvorel@suse.cz \
--cc=amir73il@gmail.com \
--cc=jack@suse.cz \
--cc=ltp@lists.linux.it \
--cc=repnop@google.com \
/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;
as well as URLs for NNTP newsgroup(s).