From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752747AbdIBP4P (ORCPT ); Sat, 2 Sep 2017 11:56:15 -0400 Received: from mx2.suse.de ([195.135.220.15]:45096 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752697AbdIBP4O (ORCPT ); Sat, 2 Sep 2017 11:56:14 -0400 Date: Sat, 2 Sep 2017 17:56:10 +0200 From: Jean Delvare To: Andy Whitcroft , Joe Perches Cc: LKML Subject: [PATCH 3/3] checkpatch: add 6 missing types to --list-types Message-ID: <20170902175610.7e4a7c9d@endymion> In-Reply-To: <20170902175111.2fcd9e85@endymion> References: <20170902175111.2fcd9e85@endymion> Organization: SUSE Linux X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.31; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Unlike all other types, LONG_LINE, LONG_LINE_COMMENT and LONG_LINE_STRING are passed to WARN() through a variable. This causes the parser in list_types() to miss them and consequently they are not present in the output of --list-types. Additionally, types TYPO_SPELLING, FSF_MAILING_ADDRESS and AVOID_BUG are passed with a variable level, causing the parser to miss them too. So modify the regex to also catch these special cases. Signed-off-by: Jean Delvare Fixes: 3beb42eced39 ("checkpatch: add --list-types to show message types to show or ignore") Cc: Andy Whitcroft Cc: Joe Perches --- scripts/checkpatch.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- linux-4.13-rc7.orig/scripts/checkpatch.pl 2017-09-02 17:46:45.852024037 +0200 +++ linux-4.13-rc7/scripts/checkpatch.pl 2017-09-02 17:46:55.925163818 +0200 @@ -145,7 +145,8 @@ sub list_types { close($script); my @types = (); - for ($text =~ /\b(?:(?:CHK|WARN|ERROR)\s*\(\s*"([^"]+)")/g) { + # Also catch when type or level is passed through a variable + for ($text =~ /(?:(?:\bCHK|\bWARN|\bERROR|&\{\$msg_level})\s*\(|\$msg_type\s*=)\s*"([^"]+)"/g) { push (@types, $_); } @types = sort(uniq(@types)); -- Jean Delvare SUSE L3 Support