All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 8/8] syscalls/setresuid03: Convert to new API
Date: Tue, 14 Sep 2021 07:06:51 +0200	[thread overview]
Message-ID: <YUAt6/LvtDTVENJB@pevik> (raw)
In-Reply-To: <YT9laHIulnmtBSgK@yuki>

> Hi!
> > >> -?????? if (getpwnam("bin") == NULL) {
> > >> -?????????????? tst_brkm(TBROK, NULL, "bin must be a valid user.");
> > >> +?????? if (TST_ERR != tc->exp_errno) {
> > > nit: checkpatch complains (TST_ERR should be second)

> > checkpatch.pl wrongly assumes that TST_ERR is a constant.

> Good catch, I guess that we will have to patch checkpatch to ignore
> macros that start with TST_, what about?

> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 88cb294dc..87572b2f4 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -5462,7 +5462,9 @@ sub process {
>                         my $comp = $3;
>                         my $to = $4;
>                         my $newcomp = $comp;
> -                       if ($lead !~ /(?:$Operators|\.)\s*$/ &&
> +
> +                       if ($const !~ /^\QTST_/ &&
> +                           $lead !~ /(?:$Operators|\.)\s*$/ &&
>                             $to !~ /^(?:Constant|[A-Z_][A-Z0-9_]*)$/ &&
>                             WARN("CONSTANT_COMPARISON",
>                                  "Comparisons should place the constant on the right side of the test\n" . $herecurr) &&

Yep, that works, thanks!

Kind regards,
Petr

WARNING: multiple messages have this Message-ID (diff)
From: Petr Vorel <pvorel@suse.cz>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 8/8] syscalls/setresuid03: Convert to new API
Date: Tue, 14 Sep 2021 07:06:51 +0200	[thread overview]
Message-ID: <YUAt6/LvtDTVENJB@pevik> (raw)
Message-ID: <20210914050651.9N0oKXbVfWoIgaePrkdB8ghGMiOxjuhfxNIunbKITNQ@z> (raw)
In-Reply-To: <YT9laHIulnmtBSgK@yuki>

> Hi!
> > >> -?????? if (getpwnam("bin") == NULL) {
> > >> -?????????????? tst_brkm(TBROK, NULL, "bin must be a valid user.");
> > >> +?????? if (TST_ERR != tc->exp_errno) {
> > > nit: checkpatch complains (TST_ERR should be second)

> > checkpatch.pl wrongly assumes that TST_ERR is a constant.

> Good catch, I guess that we will have to patch checkpatch to ignore
> macros that start with TST_, what about?

> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 88cb294dc..87572b2f4 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -5462,7 +5462,9 @@ sub process {
>                         my $comp = $3;
>                         my $to = $4;
>                         my $newcomp = $comp;
> -                       if ($lead !~ /(?:$Operators|\.)\s*$/ &&
> +
> +                       if ($const !~ /^\QTST_/ &&
> +                           $lead !~ /(?:$Operators|\.)\s*$/ &&
>                             $to !~ /^(?:Constant|[A-Z_][A-Z0-9_]*)$/ &&
>                             WARN("CONSTANT_COMPARISON",
>                                  "Comparisons should place the constant on the right side of the test\n" . $herecurr) &&

Yep, that works, thanks!

Kind regards,
Petr

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

  reply	other threads:[~2021-09-14  5:06 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-09 15:51 [LTP] [PATCH 1/8] syscalls/rename09: Simplify and convert to new API Martin Doucha
2021-09-09 15:51 ` Martin Doucha
2021-09-09 15:51 ` [LTP] [PATCH 2/8] Add SAFE_SETRESUID()/SAFE_SETRESGID() helper functions Martin Doucha
2021-09-09 15:51   ` Martin Doucha
2021-09-09 15:51 ` [LTP] [PATCH 3/8] Add tst_check_resuid() and tst_check_resgid() " Martin Doucha
2021-09-09 15:51   ` Martin Doucha
2021-09-09 15:51 ` [LTP] [PATCH 4/8] syscalls/setresgid02: Convert to new API Martin Doucha
2021-09-09 15:51   ` Martin Doucha
2021-09-10 14:33   ` Cyril Hrubis
2021-09-10 14:33     ` Cyril Hrubis
2021-09-09 15:51 ` [LTP] [PATCH 5/8] syscalls/setresgid03: " Martin Doucha
2021-09-09 15:51   ` Martin Doucha
2021-09-09 15:51 ` [LTP] [PATCH 6/8] syscalls/setresuid01: " Martin Doucha
2021-09-09 15:51   ` Martin Doucha
2021-09-09 15:51 ` [LTP] [PATCH 7/8] syscalls/setresuid02: " Martin Doucha
2021-09-09 15:51   ` Martin Doucha
2021-09-09 15:51 ` [LTP] [PATCH 8/8] syscalls/setresuid03: " Martin Doucha
2021-09-09 15:51   ` Martin Doucha
2021-09-09 16:32   ` pvorel
2021-09-09 16:32     ` pvorel
2021-09-10 14:29     ` Cyril Hrubis
2021-09-10 14:29       ` Cyril Hrubis
2021-09-10 19:05       ` Petr Vorel
2021-09-10 19:05         ` Petr Vorel
2021-09-13  9:12       ` Martin Doucha
2021-09-13  9:12         ` Martin Doucha
2021-09-13 14:11     ` Martin Doucha
2021-09-13 14:11       ` Martin Doucha
2021-09-13 14:46       ` Petr Vorel
2021-09-13 14:46         ` Petr Vorel
2021-09-13 14:51       ` Cyril Hrubis
2021-09-13 14:51         ` Cyril Hrubis
2021-09-14  5:06         ` Petr Vorel [this message]
2021-09-14  5:06           ` Petr Vorel
2021-09-14  9:50           ` Cyril Hrubis
2021-09-14  9:50             ` Cyril Hrubis

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=YUAt6/LvtDTVENJB@pevik \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.