Re: [PATCH] checkpatch: Improve warning message for "needless if" case

From: Joe Perches
Date: Tue Oct 21 2014 - 12:40:21 EST


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.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/