From: Dan Carpenter <dan.carpenter@oracle.com>
To: Joe Perches <joe@perches.com>
Cc: Andy Whitcroft <apw@canonical.com>, linux-kernel@vger.kernel.org
Subject: Re: [patch] checkpatch: warn on missing spaces in broken up quoted strings
Date: Fri, 13 Jun 2014 12:46:51 +0300 [thread overview]
Message-ID: <20140613094651.GF5015@mwanda> (raw)
In-Reply-To: <1402651822.12385.31.camel@joe-AO725>
On Fri, Jun 13, 2014 at 02:30:22AM -0700, Joe Perches wrote:
> > +# check for missing a space in a string concatination
> > + if ($prevrawline =~ /[^\\][a-zA-Z]"$/ && $rawline =~ /^\+[\t ]+"[a-zA-Z]/) {
> > + WARN('MISSING_SPACE',
> > + "break quoted strings at a space character\n" . $hereprev);
> > + }
>
> Probably want digits too so maybe \w instead of "[a-zA-Z]/
>
Changing it to that adds the following 6 new warnings:
./drivers/staging/media/lirc/lirc_zilog.c:806 "1) -- please upgrade to a newer driver",
- bug.
./drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c:529 "24G_A[%d] = 0x%x\n", i,
./drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c:537 "24G_C[%d] = 0x%x\n", i,
- the "24G_A" is the last 5 characters of a variable name so
this is sloppy code.
./drivers/scsi/pm8001/pm8001_ctl.c:297 "0x%08x 0x%08x\n",
./drivers/scsi/pm8001/pm8001_ctl.c:432 "0x%08x 0x%08x\n",
./drivers/scsi/qla2xxx/qla_nx2.c:1457 "0x%X 0x%X 0x%X 0x%X 0x%X 0x%X\n"
- hex false positives
I thought about doing that when I wrote my original patch but I was
worried about more hex false positives. If there are only those 3 then
it's probably not a big deal. What do you think?
regards,
dan carpenter
next prev parent reply other threads:[~2014-06-13 9:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-13 6:53 [patch] checkpatch: warn on missing spaces in broken up quoted strings Dan Carpenter
2014-06-13 9:30 ` Joe Perches
2014-06-13 9:46 ` Dan Carpenter [this message]
2014-06-13 19:52 ` Joe Perches
2014-06-16 6:40 ` Dan Carpenter
2014-06-16 18:27 ` Joe Perches
2014-07-23 11:56 ` Dan Carpenter
2014-07-23 12:11 ` [patch v2] checkpatch: warn on missing spaces in broken up quoted Dan Carpenter
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=20140613094651.GF5015@mwanda \
--to=dan.carpenter@oracle.com \
--cc=apw@canonical.com \
--cc=joe@perches.com \
--cc=linux-kernel@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).