All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dwaipayan Ray <dwaipayanray1@gmail.com>
To: Joe Perches <joe@perches.com>
Cc: linux-kernel-mentees@lists.linuxfoundation.org,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Lukas Bulwahn <lukas.bulwahn@gmail.com>
Subject: Re: [PATCH v5] checkpatch: extend attributes check to handle more patterns
Date: Mon, 26 Oct 2020 00:18:40 +0530	[thread overview]
Message-ID: <CABJPP5Azq7Pnq+Ki5gKjAGuymHGxK0HwTKsWWw6t3p4dmOSzaw@mail.gmail.com> (raw)
In-Reply-To: <52f88d0bb938c5063ede693a05bf64961af5a496.camel@perches.com>

> > +                     if (scalar @conv_array > 0 && $conv_possible == 1) {
> > +                             my $replace = join(' ', @conv_array);
> > +                             if (WARN("PREFER_DEFINED_ATTRIBUTE_MACRO",
> > +                                      "$replace is preferred over __attribute__(($attr))\n" . $herecurr) &&
> > +                                     $fix) {
> > +                                     $fixed[$fixlinenr] =~ s/\b__attribute__\s*\(\s*\(\s*\Q$attr\E\s*\)\s*\)/$replace/;
>
> I looks it would be useful to add
>                                         $fixed[$fixlinenr] =~ s/\}\Q$replace\E/} $replace/;
> so there's a space added between } and any replacements.
>
Hi once again,
Sorry to interrupt your work so many times.

I tried this and seems the space is being applied even without this
fix.
I think the spacing check applies this fix already.

if (ERROR("SPACING",
"space required after that close brace '}'\n" . $herecurr) &&
$fix) {
$fixed[$fixlinenr] =~
s/}((?!(?:,|;|\)))\S)/} $1/;
}

So do you think it's okay without that perhaps?

Thanks,
Dwaipayan.

WARNING: multiple messages have this Message-ID (diff)
From: Dwaipayan Ray <dwaipayanray1@gmail.com>
To: Joe Perches <joe@perches.com>
Cc: linux-kernel-mentees@lists.linuxfoundation.org,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [Linux-kernel-mentees] [PATCH v5] checkpatch: extend attributes check to handle more patterns
Date: Mon, 26 Oct 2020 00:18:40 +0530	[thread overview]
Message-ID: <CABJPP5Azq7Pnq+Ki5gKjAGuymHGxK0HwTKsWWw6t3p4dmOSzaw@mail.gmail.com> (raw)
In-Reply-To: <52f88d0bb938c5063ede693a05bf64961af5a496.camel@perches.com>

> > +                     if (scalar @conv_array > 0 && $conv_possible == 1) {
> > +                             my $replace = join(' ', @conv_array);
> > +                             if (WARN("PREFER_DEFINED_ATTRIBUTE_MACRO",
> > +                                      "$replace is preferred over __attribute__(($attr))\n" . $herecurr) &&
> > +                                     $fix) {
> > +                                     $fixed[$fixlinenr] =~ s/\b__attribute__\s*\(\s*\(\s*\Q$attr\E\s*\)\s*\)/$replace/;
>
> I looks it would be useful to add
>                                         $fixed[$fixlinenr] =~ s/\}\Q$replace\E/} $replace/;
> so there's a space added between } and any replacements.
>
Hi once again,
Sorry to interrupt your work so many times.

I tried this and seems the space is being applied even without this
fix.
I think the spacing check applies this fix already.

if (ERROR("SPACING",
"space required after that close brace '}'\n" . $herecurr) &&
$fix) {
$fixed[$fixlinenr] =~
s/}((?!(?:,|;|\)))\S)/} $1/;
}

So do you think it's okay without that perhaps?

Thanks,
Dwaipayan.
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

  parent reply	other threads:[~2020-10-25 18:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-25 10:15 [PATCH v5] checkpatch: extend attributes check to handle more patterns Dwaipayan Ray
2020-10-25 10:15 ` [Linux-kernel-mentees] " Dwaipayan Ray
2020-10-25 17:59 ` Joe Perches
2020-10-25 17:59   ` [Linux-kernel-mentees] " Joe Perches
2020-10-25 18:10   ` Dwaipayan Ray
2020-10-25 18:10     ` [Linux-kernel-mentees] " Dwaipayan Ray
2020-10-25 18:19     ` Joe Perches
2020-10-25 18:19       ` [Linux-kernel-mentees] " Joe Perches
2020-10-25 18:26       ` Dwaipayan Ray
2020-10-25 18:26         ` [Linux-kernel-mentees] " Dwaipayan Ray
2020-10-25 18:48   ` Dwaipayan Ray [this message]
2020-10-25 18:48     ` Dwaipayan Ray

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=CABJPP5Azq7Pnq+Ki5gKjAGuymHGxK0HwTKsWWw6t3p4dmOSzaw@mail.gmail.com \
    --to=dwaipayanray1@gmail.com \
    --cc=joe@perches.com \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukas.bulwahn@gmail.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 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.