linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] checkpatch: test missing initial blank line in block comment
@ 2017-04-03  8:08 Hugues Fruchet
  2017-04-03  8:08 ` Hugues Fruchet
  0 siblings, 1 reply; 10+ messages in thread
From: Hugues Fruchet @ 2017-04-03  8:08 UTC (permalink / raw)
  To: Andy Whitcroft, Joe Perches; +Cc: linux-kernel

Hi checkpatch maintainers,

here is a patch tentative to raise a warning when multiple line block comments
are not starting with empty blank comment:

Warn when block comments are not starting with blank comment:
    /* multiple lines
     * block comment,
     * => warning
     */

    /*
     * multiple lines
     * block comment,
     * => no warning
     */

Exception made for networking files where rule is the
exact opposite.


* sample output:

$ scripts/checkpatch.pl -f drivers/media/v4l2-core/* | grep empty -A2
WARNING: Block comments starts with an empty /*
#393: FILE: drivers/media/v4l2-core/v4l2-compat-ioctl32.c:393:
+	/* For MMAP, driver might've set up the offset, so copy it back.
--
WARNING: Block comments starts with an empty /*
#661: FILE: drivers/media/v4l2-core/v4l2-ctrls.c:661:
+	/* The MPEG controls are applicable to all codec controls
--
+	/* Add immediately at the end of the list if the list is empty, or if
+	   the last element in the list has a lower ID.
[...]


* sample output in drivers/net/ (non-regression check):

$ scripts/checkpatch.pl -f drivers/net/*/* | grep empty -A2
WARNING: networking block comments don't use an empty /* line, use /* Comment...
#39: FILE: drivers/net/appletalk/cops.c:39:
+/*
--
WARNING: networking block comments don't use an empty /* line, use /* Comment...
#45: FILE: drivers/net/appletalk/cops.c:45:
+/*
--
[...]

Hugues Fruchet (1):
  checkpatch: test missing initial blank line in block comment

 scripts/checkpatch.pl | 11 +++++++++++
 1 file changed, 11 insertions(+)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-04-07 10:22 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-03  8:08 [PATCH v1] checkpatch: test missing initial blank line in block comment Hugues Fruchet
2017-04-03  8:08 ` Hugues Fruchet
2017-04-03 19:06   ` Joe Perches
2017-04-05  8:23     ` Hugues FRUCHET
2017-04-05  8:35       ` Joe Perches
2017-04-05  9:43         ` Hugues FRUCHET
2017-04-05  9:55           ` Joe Perches
2017-04-05 13:26             ` Hugues FRUCHET
2017-04-07  9:56               ` Hugues FRUCHET
2017-04-07 10:22                 ` Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).