mbox series

[0/3] fanotify{14,20}: cleanup

Message ID 20220906092615.15116-1-pvorel@suse.cz
Headers show
Series fanotify{14,20}: cleanup | expand

Message

Petr Vorel Sept. 6, 2022, 9:26 a.m. UTC
Hi,

just an example how to further cleanup fanotify tests by using test macros
from include/tst_test_macros.h. This can wait till Amir's FAN_MARK_IGNORE
patchset [1] is merged (unless there is going to be v2).

fanotify20 is an example what I'd address in the code, fanotify14 just
uses newly added TST_EXP_FD_ERRNO() (more cleanup here and actually in
other tests could be done).

I also admit code in include/tst_test_macros.h is a bit hard to read due
being macro. We should probably add some documentation to it.

Kind regards,
Petr

[1] https://lore.kernel.org/ltp/20220905154239.2652169-1-amir73il@gmail.com/

Petr Vorel (3):
  tst_test_macros: Add TST_EXP_FD_ERRNO
  fanotify20: Simplify code
  fanotify14: Use TST_EXP_FD_ERRNO()

 include/tst_test_macros.h                     |  10 ++
 .../kernel/syscalls/fanotify/fanotify14.c     | 118 +++++-------------
 .../kernel/syscalls/fanotify/fanotify20.c     |  81 +++---------
 3 files changed, 62 insertions(+), 147 deletions(-)

Comments

Matthew Bobrowski Sept. 7, 2022, 7:24 a.m. UTC | #1
On Tue, Sep 06, 2022 at 11:26:12AM +0200, Petr Vorel wrote:
> Hi,
> 
> just an example how to further cleanup fanotify tests by using test macros
> from include/tst_test_macros.h. This can wait till Amir's FAN_MARK_IGNORE
> patchset [1] is merged (unless there is going to be v2).
>
> fanotify20 is an example what I'd address in the code, fanotify14 just
> uses newly added TST_EXP_FD_ERRNO() (more cleanup here and actually in
> other tests could be done).

So, are you suggesting that we have a TODO list? ;)

> I also admit code in include/tst_test_macros.h is a bit hard to read due
> being macro. We should probably add some documentation to it.

Documentation is always nice. A lot of time could be saved as a result
of not having to decipher a given macro.

/M
Petr Vorel Sept. 7, 2022, 11:05 a.m. UTC | #2
> On Tue, Sep 06, 2022 at 11:26:12AM +0200, Petr Vorel wrote:
> > Hi,

> > just an example how to further cleanup fanotify tests by using test macros
> > from include/tst_test_macros.h. This can wait till Amir's FAN_MARK_IGNORE
> > patchset [1] is merged (unless there is going to be v2).

> > fanotify20 is an example what I'd address in the code, fanotify14 just
> > uses newly added TST_EXP_FD_ERRNO() (more cleanup here and actually in
> > other tests could be done).

> So, are you suggesting that we have a TODO list? ;)
Well, I would not dare this :). Amir wrote he's planning to do some cleanup,
but if you kernel maintainers are busy, I can do it. We really appreciate how
well you maintain tests for your kernel subsystem (I wish there were more kernel
maintainers as active as you).

> > I also admit code in include/tst_test_macros.h is a bit hard to read due
> > being macro. We should probably add some documentation to it.

> Documentation is always nice. A lot of time could be saved as a result
> of not having to decipher a given macro.
It's on my TODO list, hopefully I'll do it soon.

Kind regards,
Petr

> /M