Linux Test Project
 help / color / mirror / Atom feed
From: Richard Palethorpe <rpalethorpe@suse.de>
To: Petr Vorel <pvorel@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 4/5] Add pidfd_getfd01 test
Date: Mon, 21 Feb 2022 13:49:04 +0000	[thread overview]
Message-ID: <87fsocjofw.fsf@suse.de> (raw)
In-Reply-To: <YhOI0W/PtQJP8fGK@pevik>

Hello Petr,

Petr Vorel <pvorel@suse.cz> writes:

> Hi Richie,
>
>> Hello Petr,
>
>> Petr Vorel <pvorel@suse.cz> writes:
>
>> > Hi Richie, Xu,
>
>> >> Hi Petr
>> >> > Hi Xu,
>
>> >> > ...
>> >> >> +++ b/testcases/kernel/syscalls/pidfd_getfd/pidfd_getfd01.c
>> >> > ...
>> >> >> +	remotefd = TST_RET;
>> >> >> +	flag = fcntl(remotefd, F_GETFD);
>> >> >> +	if (flag == -1)
>> >> >> +		tst_brk(TFAIL | TERRNO, "fcntl(F_GETFD) failed");
>> >> > Just:
>> >> > flag = SAFE_FCNTL(remotefd, F_GETFD);
>> >> Yes, I almost forgot we have this macro.
>> > @Richie: It'd be useful if sparse checks would suggest to use SAFE_*()
>> > functions, but not sure if easily detectable. Something like setup() and
>> > cleanup() function and syscall followed by if (foo == -1) followed by tst_brk().
>
>> > Kind regards,
>> > Petr
>
>> Yeah, this would be relatively simple in Coccinelle. In Sparse I'm not
>> sure, but it is one of the main use cases IMO.
> I remember few years ago (2017) metan did big cleanup with Coccinelle.
> If much simpler, we might want to introduce some basic scripts (without
> vendoring Coccinelle, it'd have to be installed).

Indeed, we already have some in scripts/coccinelle. These are mainly
useful for refactoring.

>
>> Hopefully the IR produced by these code patterns is fairly stable. In
>> that case we can do some simple pattern matching.
> Frankly speaking, if ever implemented it's probably you who is going to
> implement it, thus your choice what you use :).
>
> Kind regards,
> Petr

Yeah, although it still needs reviewing :-p

-- 
Thank you,
Richard.

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2022-02-21 14:15 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-16 10:04 [LTP] [PATCH 1/5] kcmp.h: move it to ltp include/lapi directory Yang Xu
2022-02-16 10:04 ` [LTP] [PATCH 2/5] lapi/kcmp.h: Replace GPL with SPDX-License-Identifier Yang Xu
2022-02-16 14:05   ` Petr Vorel
2022-02-17 18:52   ` Petr Vorel
2022-02-18  2:13     ` xuyang2018.jy
2022-02-18  8:28       ` Petr Vorel
2022-02-16 10:04 ` [LTP] [PATCH 3/5] pidfd_getfd.h: add fallback Yang Xu
2022-02-16 14:09   ` Petr Vorel
2022-02-18  2:14     ` xuyang2018.jy
2022-02-16 10:04 ` [LTP] [PATCH 4/5] Add pidfd_getfd01 test Yang Xu
2022-02-17 19:20   ` Petr Vorel
2022-02-18  3:24     ` xuyang2018.jy
2022-02-18  7:02       ` Petr Vorel
2022-02-21 10:03         ` Richard Palethorpe
2022-02-21 12:42           ` Petr Vorel
2022-02-21 13:49             ` Richard Palethorpe [this message]
2022-02-18  8:57       ` Petr Vorel
2022-02-18  9:56         ` xuyang2018.jy
2022-02-18 10:15           ` Petr Vorel
2022-02-22  2:29             ` xuyang2018.jy
2022-02-17 19:28   ` Petr Vorel
2022-02-18  3:37     ` xuyang2018.jy
2022-02-18  6:59       ` Petr Vorel
2022-02-16 10:04 ` [LTP] [PATCH 5/5] syscalls/pidfd_getfd02: add basic error test Yang Xu
2022-02-17 19:56   ` Petr Vorel
2022-02-18  3:49     ` xuyang2018.jy
2022-02-18  6:50       ` Petr Vorel
2022-02-18  7:03         ` xuyang2018.jy
2022-02-18 10:58       ` Petr Vorel
2022-02-22  2:49         ` xuyang2018.jy
2022-02-16 14:02 ` [LTP] [PATCH 1/5] kcmp.h: move it to ltp include/lapi directory 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=87fsocjofw.fsf@suse.de \
    --to=rpalethorpe@suse.de \
    --cc=ltp@lists.linux.it \
    --cc=pvorel@suse.cz \
    /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