All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] gpu/drm: ingenic: Delete an error message in ingenic_drm_probe()
Date: Wed, 08 Apr 2020 09:42:44 +0000	[thread overview]
Message-ID: <20200408094244.GM2001@kadam> (raw)
In-Reply-To: <e03e7106-0f22-99c4-ad21-b288e8990b5a@web.de>

On Mon, Apr 06, 2020 at 07:48:52PM +0200, Christophe JAILLET wrote:
> Nevertheless, I wrote another script (see below), which triggers ~2800 times
> in ./drivers only.
> Some are false positives, but most look valid.

I did a quick grep and you're right there are a ton of these!

> 
> Not sure that fixing this kind of stuff really make sense.
> 
> A better approach could be to teach ./checkpatch.pl, but I don't have the
> knowledge for that.

Yeah.  I think so too.  Here is what I tried.  $logFunctions ends up
catching too many functions like process_mcheck_info() so maybe we need
a stricter regex for that.

regards,
dan carpenter

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index d64c67b67e3c..1bcfa9e18059 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -5493,6 +5493,13 @@ sub process {
 			     "Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst\n" . $herecurr);
 		}
 
+# check for missing newline
+		if ($line =~ /\t$logFunctions\b.*$String[,)]/ && $rawline !~ /\\n/ &&
+			$rawline !~ / "[,)]/ &&
+			$line !~ /debugfs_/ && $line !~ /MODULE_/) {
+			WARN("MISSING_NEWLINE", "Missing newline?\n" . $herecurr);
+		}
+
 # Check for user-visible strings broken across lines, which breaks the ability
 # to grep for the string.  Make exceptions when the previous string ends in a
 # newline (multiple lines in one string constant) or '\t', '\r', ';', or '{'

  parent reply	other threads:[~2020-04-08  9:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-05  9:30 [PATCH] gpu/drm: ingenic: Delete an error message in ingenic_drm_probe() Markus Elfring
2020-04-05  9:30 ` Markus Elfring
2020-04-05  9:30 ` Markus Elfring
2020-04-05 11:49 ` Paul Cercueil
2020-04-05 11:49   ` Paul Cercueil
2020-04-05 11:49   ` Paul Cercueil
2020-04-05 17:27 ` Christophe JAILLET
2020-04-05 17:54 ` Julia Lawall
2020-04-05 18:52 ` Christophe JAILLET
2020-04-06 17:48 ` Christophe JAILLET
2020-04-06 18:50 ` Julia Lawall
2020-04-07 20:42 ` Paul Cercueil
2020-04-07 20:42   ` Paul Cercueil
2020-04-07 20:42   ` Paul Cercueil
2020-04-08  9:42 ` Dan Carpenter [this message]
2020-04-08  9:49 ` 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=20200408094244.GM2001@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.