Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2252039pxb; Fri, 5 Mar 2021 10:45:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJwHnqVYLrXa2FPyH5Q7yk6Ti0pNYCyWsdUzrD/kN7IDoG1IlnUfTAEPL4RBdrhEVnOT1DcB X-Received: by 2002:a50:ef11:: with SMTP id m17mr3983312eds.151.1614969943347; Fri, 05 Mar 2021 10:45:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614969943; cv=none; d=google.com; s=arc-20160816; b=jkF9Qrx9jBPFtkOAr4EBgRdwheoO7HpTEh3w4XENgwUZTi50hW0xZF25HRJuX+ccHm rnTrLbCpRVBqxuBNExMdciSav8A3IqA+q0PmMWyOOhzQI/Sb+iAJrmX1SDCsOcYFbq1G s6NbZEX+GPXZP5DIyk150vQwmVzIl2FoCGUkaY5ZqyMYLMCvGlO0Eq30XVmFQVCZd4V/ P4biDnfoDZ4u+PzW9AnAfJCaq/ld2CMhPzubwG8CaW/RcIKPjAwn74uqywqaY2AkIeDx 6hviQChZg9Tj2sGYd0NvxWYFV6BbFifBbV5BSIHJiUDO6VPQ8M1kyF6IWZXQJsqb5URD CEow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=sIGgzA66tHNsHeYn52XPo7JeAyKpJREW3Whf9/UDz4Y=; b=nfY6iLI9sGt3bRIhfMSkQxrCtw0RQ/4AvYxvfSpckgXEQwVaOz3EoemM4aWHk4Im6l txWDshuixAKHB8DzcCoEkomIpBd07DSB0WZQZKyVKG9/pfvq+N01C+cYqt0VPd8vthf0 kpH4FtezZ6dbMZxyS4ghnWGcNMlqiS/B8LsX2QTSEJ+CPipNa4rDEQDABgfAflaGsP/b TJeD5DbLzyhlNa2ak0iIYWzJzOt0QJWPni+l3UIokgdDHVsm/VvZcHC0Z2quNB/FpGN8 TjBcxFosy9qqrZ9PC1nOEOglKQrjODo7HSPgWbs1xFX0DmKEMShW5UvwF1rU8yFvsNmP hO6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=OpnKc2NA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lc7si1854190ejb.426.2021.03.05.10.45.20; Fri, 05 Mar 2021 10:45:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=OpnKc2NA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229563AbhCESoD (ORCPT + 99 others); Fri, 5 Mar 2021 13:44:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229591AbhCESnl (ORCPT ); Fri, 5 Mar 2021 13:43:41 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEF28C061574; Fri, 5 Mar 2021 10:43:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=sIGgzA66tHNsHeYn52XPo7JeAyKpJREW3Whf9/UDz4Y=; b=OpnKc2NA/LxZwoGWyc+vlOOaWP yuxaV1NSzwOKD5oALjsHc5ar2eyGku1gpkXfZXWrJQeYg3GebuJggCh5voJFZ4m0PCupLcRcbj2wN 8mjYj+4QhF7hAYPK6arrF80Z8qDrGC/FoOQHJPzhJjaCXAtdKoQAsaaZ5QXvENYd1noOiQJy6OwJC hS55Yxrv+91mmq3wFsmY3vi19i57u3bLwlJOLTL4abU/HxLphOPER7Nq0l7oBMFi8/fidBFwHPaHK qtKcUiRze1HSCaoM++0S/gNbDuaHzItcbTCaK+HWbToYFDuujgbsgT7NSos9Dbq0Hfx6q//9mNr2O C9N9k6VA==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lIFQ2-00C85B-3R; Fri, 05 Mar 2021 18:43:23 +0000 Date: Fri, 5 Mar 2021 18:43:22 +0000 From: Matthew Wilcox To: Aditya Srivastava Cc: corbet@lwn.net, lukas.bulwahn@gmail.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org Subject: Re: [RFC] scripts: kernel-doc: fix attribute capture in function parsing Message-ID: <20210305184322.GN2723601@casper.infradead.org> References: <20210305182000.8363-1-yashsri421@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210305182000.8363-1-yashsri421@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 05, 2021 at 11:50:00PM +0530, Aditya Srivastava wrote: > Provide a simple fix by adding "__attribute_const__" in the corresponding > regex expression. > > A quick evaluation by running 'kernel-doc -none' on kernel-tree reveals > that no additional warning or error has been added or removed by the fix. I'm no perlmonger, but why isn't this simply: +++ b/scripts/kernel-doc @@ -1753,6 +1753,7 @@ sub dump_function($$) { $prototype =~ s/^__inline +//; $prototype =~ s/^__always_inline +//; $prototype =~ s/^noinline +//; + $prototype =~ s/__attribute_const__ +//; $prototype =~ s/__init +//; $prototype =~ s/__init_or_module +//; $prototype =~ s/__meminit +//; (completely untested) > +++ b/scripts/kernel-doc > @@ -1753,6 +1753,7 @@ sub dump_function($$) { > my $prototype = shift; > my $file = shift; > my $noret = 0; > + my $attribute_const = qr{__attribute_const__}; > > print_lineno($new_start_line); > > @@ -1808,7 +1809,7 @@ sub dump_function($$) { > $prototype =~ m/^(\w+)\s+([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ || > $prototype =~ m/^(\w+\s*\*+)\s*([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ || > $prototype =~ m/^(\w+\s+\w+)\s+([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ || > - $prototype =~ m/^(\w+\s+\w+\s*\*+)\s*([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ || > + $prototype =~ m/^(\w+\s+\w+\s*\*+$attribute_const?)\s*([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ || > $prototype =~ m/^(\w+\s+\w+\s+\w+)\s+([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ || > $prototype =~ m/^(\w+\s+\w+\s+\w+\s*\*+)\s*([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ || > $prototype =~ m/^()([a-zA-Z0-9_~:]+)\s*\(([^\{]*)\)/ ||