* [PATCH] checkpatch: Improve warning message for "needless if" case
@ 2014-10-21 14:33 Fabio Estevam
2014-10-21 16:40 ` Joe Perches
0 siblings, 1 reply; 4+ messages in thread
From: Fabio Estevam @ 2014-10-21 14:33 UTC (permalink / raw)
To: joe; +Cc: festevam, akpm, linux-kernel, Fabio Estevam
Break the sentence so that it looks better:
WARNING: debugfs_remove(NULL) is safe. This check is probably not required
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
scripts/checkpatch.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index d94f5d8..99653bb 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -4446,7 +4446,7 @@ sub process {
my $expr = '\s*\(\s*' . quotemeta($1) . '\s*\)\s*;';
if ($line =~ /\b(kfree|usb_free_urb|debugfs_remove(?:_recursive)?)$expr/) {
WARN('NEEDLESS_IF',
- "$1(NULL) is safe this check is probably not required\n" . $hereprev);
+ "$1(NULL) is safe. This check is probably not required\n" . $hereprev);
}
}
--
1.9.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] checkpatch: Improve warning message for "needless if" case
2014-10-21 14:33 [PATCH] checkpatch: Improve warning message for "needless if" case Fabio Estevam
@ 2014-10-21 16:40 ` Joe Perches
2014-10-21 16:44 ` Fabio Estevam
0 siblings, 1 reply; 4+ messages in thread
From: Joe Perches @ 2014-10-21 16:40 UTC (permalink / raw)
To: Fabio Estevam; +Cc: festevam, akpm, linux-kernel
On Tue, 2014-10-21 at 12:33 -0200, Fabio Estevam wrote:
> Break the sentence so that it looks better:
>
> WARNING: debugfs_remove(NULL) is safe. This check is probably not required
[]
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -4446,7 +4446,7 @@ sub process {
> my $expr = '\s*\(\s*' . quotemeta($1) . '\s*\)\s*;';
> if ($line =~ /\b(kfree|usb_free_urb|debugfs_remove(?:_recursive)?)$expr/) {
> WARN('NEEDLESS_IF',
> - "$1(NULL) is safe this check is probably not required\n" . $hereprev);
> + "$1(NULL) is safe. This check is probably not required\n" . $hereprev);
> }
> }
>
Mixing sentences with and without periods is jarring.
I'd prefer a comma or a dash.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] checkpatch: Improve warning message for "needless if" case
2014-10-21 16:40 ` Joe Perches
@ 2014-10-21 16:44 ` Fabio Estevam
2014-10-21 16:51 ` Joe Perches
0 siblings, 1 reply; 4+ messages in thread
From: Fabio Estevam @ 2014-10-21 16:44 UTC (permalink / raw)
To: Joe Perches; +Cc: Fabio Estevam, Andrew Morton, linux-kernel
On Tue, Oct 21, 2014 at 2:40 PM, Joe Perches <joe@perches.com> wrote:
>
> Mixing sentences with and without periods is jarring.
> I'd prefer a comma or a dash.
Or what about?
"is safe and this check is probably not required"
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] checkpatch: Improve warning message for "needless if" case
2014-10-21 16:44 ` Fabio Estevam
@ 2014-10-21 16:51 ` Joe Perches
0 siblings, 0 replies; 4+ messages in thread
From: Joe Perches @ 2014-10-21 16:51 UTC (permalink / raw)
To: Fabio Estevam; +Cc: Fabio Estevam, Andrew Morton, linux-kernel
On Tue, 2014-10-21 at 14:44 -0200, Fabio Estevam wrote:
> On Tue, Oct 21, 2014 at 2:40 PM, Joe Perches <joe@perches.com> wrote:
>
> >
> > Mixing sentences with and without periods is jarring.
> > I'd prefer a comma or a dash.
>
> Or what about?
>
> "is safe and this check is probably not required"
That'd be fine too
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-10-21 17:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-21 14:33 [PATCH] checkpatch: Improve warning message for "needless if" case Fabio Estevam
2014-10-21 16:40 ` Joe Perches
2014-10-21 16:44 ` Fabio Estevam
2014-10-21 16:51 ` Joe Perches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome