Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752088AbdDCII4 (ORCPT ); Mon, 3 Apr 2017 04:08:56 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:47879 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751466AbdDCIIk (ORCPT ); Mon, 3 Apr 2017 04:08:40 -0400 From: Hugues Fruchet To: Andy Whitcroft , Joe Perches CC: Subject: [PATCH v1] checkpatch: test missing initial blank line in block comment Date: Mon, 3 Apr 2017 10:08:14 +0200 Message-ID: <1491206895-24332-1-git-send-email-hugues.fruchet@st.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.201.23.73] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-04-03_05:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1558 Lines: 58 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