From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932320AbcI1MRx (ORCPT ); Wed, 28 Sep 2016 08:17:53 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:45299 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932179AbcI1MRr (ORCPT ); Wed, 28 Sep 2016 08:17:47 -0400 From: =?UTF-8?Q?Jan_H=c3=b6ppner?= Subject: [BUG] checkpatch hangs at value annotation To: apw@canonical.com Cc: joe@perches.com, linux-kernel@vger.kernel.org Date: Wed, 28 Sep 2016 14:17:39 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16092812-0040-0000-0000-000002362D8A X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16092812-0041-0000-0000-000021F67F86 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-09-28_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609020000 definitions=main-1609280216 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andy, when I check the following patch example with checkpatch it will hang forever. diff --git a/test.c b/test.c index 88c2eb0cb608..583625fdb715 100644 --- a/test.c +++ b/test.c @@ -1 +1,3 @@ uint## BITS ##_t foobar; + +printk(KERN_WARNING "DEBUG: FOOBAR\n"); The hang is due to the spaces in the concatenation in the first line. When you remove the space (like this uint##BITS##_t) it will run through just fine. I debugged the script with perl -d a little and found that the problem is somewhere in the annotate_values sub-routine. It will always jump in this block: } elsif ($cur =~ /^($Modifier)\s*/) { print "MODIFIER($1)\n" if ($dbg_values > 1); $type = 'T'; } $1 seems to be undefined even though the regex matched. However, $1 needs to be defined so that the loop can move on with evaluating the rest of the current string (see end of the routine). If you want me to try a few more things or provide more data, please let me know. Due to lack of time and a vague knowledge of perl, I'm not able to provide a proposal for a proper fix. Best regards, Jan