From: Joe Perches <joe@perches.com>
To: Julian Calaby <julian.calaby@gmail.com>,
Bhakti Priya <bhaktipriya96@gmail.com>,
Andy Whitcroft <apw@shadowen.org>
Cc: Jes Sorensen <Jes.Sorensen@redhat.com>,
Larry Finger <Larry.Finger@lwfinger.net>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Alexander Kuleshov <kuleshovmail@gmail.com>,
Haneen Mohammed <hamohammed.sa@gmail.com>,
Andreas Ruprecht <andreas.ruprecht@fau.de>,
linux-wireless <linux-wireless@vger.kernel.org>,
"devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] staging: rtl8723au: Fixes unnecessary return warning
Date: Sat, 30 Jan 2016 04:09:34 -0800 [thread overview]
Message-ID: <1454155774.7329.3.camel@perches.com> (raw)
In-Reply-To: <CAGRGNgUPiFUyDw01RZ2iXQ-doPokdDnprqF2Jr=8mzHkbMgfvA@mail.gmail.com>
On Sat, 2016-01-30 at 23:02 +1100, Julian Calaby wrote:
> Hi Bhakti,
>
> On Sat, Jan 30, 2016 at 5:53 PM, Bhakti Priya wrote:
> > Hi,
> >
> > Thank you for your reply. I've just sent version 2 of the patch with
> > the blank lines removed.
> > I will be happy to extend checkpatch.pl. As suggested by you, I am
> > trying to detect such blank lines in a line removal patch by checking
> > if the line above the deleted line was a blank line and the line
> > following the deleted line had a closing brace.
> > Can you please guide me and let me know if I am headed in the right direction.
>
> As I understand it, the algorithm needs to work like this:
> 1. For each patch hunk:
> 2. Filter out all lines that match /^-/
> 3. Remove the first character (" " or "+")
> 4. Normalise EOL characters: s/\r\n?/\n/
> 5. Over the entire hunk, find any case that matches
> /({|\n)\s*\n\s*(\n|})/ where \s matches all space characters except
> \n.
> 6. Report the middle line the preceding regular expression matches to the user.
>
> I'm confident I can write it as a shell script, but I don't know
> enough Perl to add that test to checkpatch.pl
That's basically what the $prevline variable in checkpatch does.
Likely it's enough to check that.
Perhaps Andy Whitcroft knows.
next prev parent reply other threads:[~2016-01-30 12:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-29 17:29 [PATCH] staging: rtl8723au: Fixes unnecessary return warning Bhaktipriya Shridhar
2016-01-29 18:00 ` Jes Sorensen
2016-01-29 23:17 ` Julian Calaby
2016-01-30 1:28 ` Joe Perches
2016-01-30 3:09 ` Julian Calaby
2016-01-30 3:18 ` Joe Perches
2016-01-30 6:53 ` Bhakti Priya
2016-01-30 7:24 ` Joe Perches
2016-01-30 12:02 ` Julian Calaby
2016-01-30 12:09 ` Joe Perches [this message]
2016-01-31 14:31 ` Jes Sorensen
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=1454155774.7329.3.camel@perches.com \
--to=joe@perches.com \
--cc=Jes.Sorensen@redhat.com \
--cc=Larry.Finger@lwfinger.net \
--cc=andreas.ruprecht@fau.de \
--cc=apw@shadowen.org \
--cc=bhaktipriya96@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=hamohammed.sa@gmail.com \
--cc=julian.calaby@gmail.com \
--cc=kuleshovmail@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
/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).