Re: [PATCH] checkpatch: check for missing \n at the end of logging message
From: Dan Carpenter
Date: Thu Apr 09 2020 - 06:40:31 EST
On Wed, Apr 08, 2020 at 08:10:23PM -0700, Joe Perches wrote:
> Some types of false positives:
>
> o Many of the formats seem to end in a ':' or a ' '
> maybe those should be excluded
> #86: FILE: drivers/android/binder_alloc_selftest.c:86:
> + pr_err("free seq: ");
>
Yeah. I also ignored strings that end in a space in my version.
> o Split string formats should be excluded better
> as only the first string fragment is checked:
> #1001: FILE: drivers/ata/pata_octeon_cf.c:1001:
> + dev_info(&pdev->dev, "version " DRV_VERSION" %d bit%s.\n",
I ignored anything with a newline in it anywhere.
> + is_16bit ? 16 : 8,
> + cf_port->is_true_ide ? ", True IDE" : "");
>
> probably a few others, including a desire to check
> if a pr_cont is below the use within a few lines.
Seems tricky to implement... I think if you can't make it work it's
still usefull even with a some false positives.
regards,
dan carpenter