Re: [PATCH] checkpatch.pl: Warn on pr_<level> or dev_<level> withKERN_<level>

From: Ingo Molnar
Date: Wed Dec 09 2009 - 02:33:10 EST



* Joe Perches <joe@xxxxxxxxxxx> wrote:

> On Wed, 2009-12-09 at 07:05 +0100, Ingo Molnar wrote:
> > ( Andy: i suspect checkpatch could also grow a new warning perhaps, the
> > '\<pr_.*(KERN_.*' pattern will i suspect pinpoint something fishy in
> > most cases. )
>
> Signed-off-by: Joe Perches <joe@xxxxxxxxxxx>
> ---
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index bc4114f..ffd8210 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -1832,6 +1832,12 @@ sub process {
> }
> }
>
> +# pr_<level> and dev_<level> should not use KERN_* levels
> +
> + if ($line =~ /\b(pr_|dev_)[a-z]+.*KERN_/) {

putting \( into the pattern would further reduce the chance of false
positives.

Ingo
--
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/