Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1885967imm; Mon, 3 Sep 2018 12:02:06 -0700 (PDT) X-Google-Smtp-Source: ANB0Vda6hehY+klhCEfYym5TnFGMXvJWh8ffPDWojwj9bCHUJ1mRbO+evO9Ynsb92uPNXJW25LYh X-Received: by 2002:a63:ba55:: with SMTP id l21-v6mr12763320pgu.399.1536001326013; Mon, 03 Sep 2018 12:02:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536001325; cv=none; d=google.com; s=arc-20160816; b=zrZ9VbxoUpghMwmOTOZquCpSIMKuwZQ1ERSOkjXqbR28oFBquCKQK/vdkHF2v6ynBs wri++8lMSdTq1AFAocDItoVAZoie6I4Y653ECbkOzvIe95fqRXIrpLG4UQtW1KCoaGvo rTh52cp/8me3qPV/3Q24Za+0m6tRRS7bPexH03Sj5awpDjGD3menGUyCD6OsiLeZxFrK rNL0NzyeMdukutc3Mn9UUbmXOnWx+7IWLYNmBNKLvo2EO7sifq34wG6Ft8I2UPVHBGGk rs6SleZmpBG4KSuQmOu/QlrzTXh2c8AgSYBRJ1QBE0mNM4UD7x4afUE3GQt77k1ZYQ+u 0QsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:arc-authentication-results; bh=Y2cbDZhK+WzQCBwcS9hWBclJvtxklayNNjl+800fs04=; b=Wh505ujuDQcLRlvW5yeqE8+d2h152ca1FjEZNZbCUgw03T1NGruifufXsAQ3T6KN0t TdIBJmrx7hii8hoDfeIeWvO9iQxWhhtf4vA8F4IjbFVJ3eb5cJSKO9XxTGOd3bQc28sx qcOrXF6xyFo0rrT6Fvj5N12tLrsjSKXl2fMYrG7NAtm0IKGtLWMcfJDuvsoKG6QuDCuW TprRfPL1jrZjN6/gswnMy677bi7bztC40ndXNxhIbnnxoiEw4s1uliNF6uyn6b71Cf6W H9LlQkxrXlTG67HVOxwXNnHq4/DDdcTHpMpIfP3zYPYPR8j3tHRqRdbXit5PoPZHvNyF 0Veg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 2-v6si18733174plb.444.2018.09.03.12.01.50; Mon, 03 Sep 2018 12:02:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728074AbeICXWP (ORCPT + 99 others); Mon, 3 Sep 2018 19:22:15 -0400 Received: from ms.lwn.net ([45.79.88.28]:49780 "EHLO ms.lwn.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727493AbeICXWP (ORCPT ); Mon, 3 Sep 2018 19:22:15 -0400 Received: from lwn.net (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ms.lwn.net (Postfix) with ESMTPSA id 57FE84B7; Mon, 3 Sep 2018 19:00:44 +0000 (UTC) Date: Mon, 3 Sep 2018 13:00:43 -0600 From: Jonathan Corbet To: Heinrich Schuchardt Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] docs: kernel-doc: fix parsing of function pointers Message-ID: <20180903130043.059b2e82@lwn.net> In-Reply-To: <20180903184153.9368-1-xypron.glpk@gmx.de> References: <20180903184153.9368-1-xypron.glpk@gmx.de> Organization: LWN.net MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 3 Sep 2018 20:41:53 +0200 Heinrich Schuchardt wrote: > The same script kernel-doc is used by the U-Boot project. Interesting, I didn't know that. Please pass on my condolences :) > > kernel-doc fails to parse function definitions like the one below > > efi_status_t efi_create_event(uint32_t type, efi_uintn_t notify_tpl, > void (EFIAPI *notify_function) ( > struct efi_event *event, > void *context), > void *notify_context, efi_guid_t *group, > struct efi_event **event) > { > > due to the "EFIAPI" attribute preceding the function name. This is a good description of the problem; a proper changelog should really say what the patch *does* about the problem too. Especially since... > Signed-off-by: Heinrich Schuchardt > --- > scripts/kernel-doc | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/scripts/kernel-doc b/scripts/kernel-doc > index 31a34ced55a3..597e3223b791 100755 > --- a/scripts/kernel-doc > +++ b/scripts/kernel-doc > @@ -1381,7 +1381,7 @@ sub create_parameterlist($$$$) { > } elsif ($arg =~ m/\(.+\)\s*\(/) { > # pointer-to-function > $arg =~ tr/#/,/; > - $arg =~ m/[^\(]+\(\*?\s*([\w\.]*)\s*\)/; > + $arg =~ m/[^\(]+\([\w\s]*\*?\s*([\w\.]*)\s*\)/; The meaning of this change doesn't just jump off the screen, even for folks who are accustomed to reading regexes. It would be nice to explain what is actually being changed and what the expected new behavior is. It appears to be consuming any normal text/white space prior to the optional "*". Are you sure it doesn't overshoot and consume too much if the * isn't there? Thanks, jon