From: Julia Lawall <julia.lawall@lip6.fr>
To: Joe Perches <joe@perches.com>
Cc: Logan Gunthorpe <logang@deltatee.com>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
Andy Whitcroft <apw@canonical.com>
Subject: Re: [PATCH v2] checkpatch: Add a warning for log messages that don't end in a new line
Date: Mon, 27 Nov 2017 06:08:28 +0000 [thread overview]
Message-ID: <alpine.DEB.2.20.1711270704420.2369@hadrien> (raw)
In-Reply-To: <1511745165.20482.34.camel@perches.com>
On Sun, 26 Nov 2017, Joe Perches wrote:
> On Sun, 2017-11-26 at 23:44 +0100, Julia Lawall wrote:
> > My semantic patch and results are below. The semantic patch has some
> > features that may or may not be desired:
> >
> > 1. It goes beyond printk, pr_xxx, dev_xxx, and netdev_xxx, by finding
> > functions that are sometimes used with a format string ending with a
> > newline. To reduce false positives, such a function is ignored if it is
> > sometimes used with a string that ends in a space. This could lead to
> > false positives where actually one of the calls has a \n that it should
> > not have.
> >
> > 2. Coccinelle puts multipart strings on a single line. So the rule goes
> > a little further and eliminates the multipartness. Basically "xxx " "yyy"
> > becomes "xxx yyy" regardless of the length of the result.
>
> What about the semi-common string concatenation "foo" #var "bar" ?
I don't think this is an issue. There is no " " pattern in this. It's
true that if the pieces were on separate lines, Coccinelle will now put
them on a single line. I'm not sure I want to bother with this.
> > 3. Some prints appear not to end with a newline because they end with \n.
> > where .\n was likely intended. Instead of creating \n.\n, the semantic
> > patch just moves the .to the left of the . And if there was .\n. it just
> > drops the final period.
>
> That may be a problem if the sentence is "something...\n"
I think I was not clear. The sentence ends in ".\n.".
> There seem to be many false positives in here too.
Could you point to something specifically? I saw a lot of cases with
prints followed by returns and gotos. I guess those are not likely false
positives.
julia
next prev parent reply other threads:[~2017-11-27 6:08 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-26 5:40 [PATCH v2] checkpatch: Add a warning for log messages that don't end in a new line Logan Gunthorpe
2017-11-26 5:51 ` Julia Lawall
2017-11-26 6:01 ` Joe Perches
2017-11-26 17:38 ` Logan Gunthorpe
2017-11-26 22:29 ` Joe Perches
[not found] ` <alpine.DEB.2.20.1711262334370.2111@hadrien>
2017-11-27 1:12 ` Joe Perches
2017-11-27 6:08 ` Julia Lawall [this message]
2017-11-27 9:25 ` Joe Perches
2017-11-27 9:32 ` Julia Lawall
2017-11-27 9:42 ` Joe Perches
2017-11-27 17:07 ` Logan Gunthorpe
2017-11-27 17:26 ` Joe Perches
2017-11-27 17:33 ` Logan Gunthorpe
2017-11-27 17:41 ` Joe Perches
2017-11-27 17:42 ` Logan Gunthorpe
2017-11-27 4:00 ` Logan Gunthorpe
2017-11-27 6:11 ` Julia Lawall
2017-11-27 6:27 ` Logan Gunthorpe
2017-11-27 6:34 ` Julia Lawall
2017-11-27 6:40 ` Logan Gunthorpe
2017-11-27 8:28 ` Joe Perches
2017-11-27 8:52 ` Julia Lawall
2017-11-27 9:06 ` Joe Perches
2017-11-27 16:40 ` Logan Gunthorpe
2017-11-27 17:20 ` Logan Gunthorpe
2017-11-27 17:28 ` Joe Perches
2017-11-27 17:35 ` Logan Gunthorpe
2017-11-27 17:42 ` Joe Perches
2017-11-27 17:44 ` Logan Gunthorpe
2017-11-27 18:57 ` Joe Perches
2017-11-27 19:58 ` Logan Gunthorpe
2017-11-27 20:49 ` Julia Lawall
2017-11-27 22:56 ` Logan Gunthorpe
2017-11-28 0:15 ` Joe Perches
2017-11-26 16:55 ` Logan Gunthorpe
2017-11-26 17:09 ` Julia Lawall
2017-11-26 17:47 ` Logan Gunthorpe
2017-11-26 18:17 ` Julia Lawall
2017-11-26 18:33 ` Logan Gunthorpe
2017-11-27 1:35 ` Joe Perches
2017-11-27 6:40 ` Julia Lawall
2017-11-27 6:42 ` Julia Lawall
2017-11-27 6:53 ` Logan Gunthorpe
2017-11-27 6:57 ` Julia Lawall
2017-11-27 9:03 ` Joe Perches
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=alpine.DEB.2.20.1711270704420.2369@hadrien \
--to=julia.lawall@lip6.fr \
--cc=apw@canonical.com \
--cc=joe@perches.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=logang@deltatee.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox