From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0A260C433F5 for ; Fri, 25 Mar 2022 23:30:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234213AbiCYXcd (ORCPT ); Fri, 25 Mar 2022 19:32:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234184AbiCYXcc (ORCPT ); Fri, 25 Mar 2022 19:32:32 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1A41B864; Fri, 25 Mar 2022 16:30:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 5526EB82A33; Fri, 25 Mar 2022 23:30:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D3DDEC2BBE4; Fri, 25 Mar 2022 23:30:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648251055; bh=OH+mVAFkcKa9HVSf2zoUkEM/gONJr7udXBOVy2JElJ8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=FB6fxz+2X35s/ByuDfwm+v6X+mHQaWKQultjwxpw9ND0636dzUgPqJS/NOi4qdMf0 JYx+cAhOtn0Wdp+iGMCHsqH0ESw+hzDcRUNDZAJB2Gdfjsw1qPP36XQWkYSya3Qsry MgKe8ePNakUuk3k+R1y2OCqB1oEZnAo+WuDFDaLH1qhZAOz15shLjuh5I66xrQ3Ldr FOgVRxo6llCzAYawiG/L7qzpddh0yQvcvBnoD8o/pbSWieY1Rg0vvVUE/L6QNkzY3X fol2431Whi+BpDrT69UJjoIhJirrX4tKsmiSNC+xd6v4IxjwZhuxuVPsW53vwfzQoN io4hsdmGH2Z/A== Date: Sat, 26 Mar 2022 00:30:50 +0100 From: Mauro Carvalho Chehab To: Jonathan Corbet Cc: Linux Doc Mailing List , Hans de Goede , Stephen Rothwell , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/4] scripts/get_feat.pl: allow output the parsed file names Message-ID: <20220326003050.50750c75@coco.lan> In-Reply-To: <20220326002109.2cda0402@coco.lan> References: <874k3lg7r3.fsf@meer.lwn.net> <20220326002109.2cda0402@coco.lan> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.31; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org Em Sat, 26 Mar 2022 00:21:09 +0100 Mauro Carvalho Chehab escreveu: > Em Fri, 25 Mar 2022 13:19:28 -0600 > Jonathan Corbet escreveu: > > > Mauro Carvalho Chehab writes: > > > > > Such output could be helpful while debugging it, but its main > > > goal is to tell kernel_feat.py about what files were used > > > by the script. Thie way, kernel_feat.py can add those as > > > documentation dependencies. > > > > > > Signed-off-by: Mauro Carvalho Chehab > > > > So I think these are worth getting into 5.18, > > Yeah, agreed. > > > but I do have one question: > > > > > @@ -95,6 +97,10 @@ sub parse_feat { > > > return if ($file =~ m,($prefix)/arch-support.txt,); > > > return if (!($file =~ m,arch-support.txt$,)); > > > > > > + if ($enable_fname) { > > > + printf "#define FILE %s\n", abs_path($file); > > > + } > > > + > > > > Why do you output the file names in this format? This isn't input to > > the C preprocessor, so the #define just seems strange. What am I > > missing here? > > Well, I didn't think much about that... I just ended using a way that is > already used on get_abi.pl, and was originally imported from kernel-doc :-) > > It could be using whatever other tag, but I would keep those three scripts > using a similar markup string for file names and line numbers: > > scripts/get_abi.pl: > printf "#define LINENO %s%s#%s\n\n", $prefix, $file[0], $data{$what}->{line_no}; > > scripts/kernel-doc: > print "#define LINENO " . $lineno . "\n"; Btw, maybe we could replace them tree with a Sphinx comment, like: get_feat.pl: .. FILE kernel-doc: .. LINE get_abi.pl: .. FILE_LINE : (or something similar) Just let me know what you prefer and I can take care of the needed changes on this patch and, if it is the case, writing the extra patches in order to use the same model on kernel-doc and get_abi.pl. Thanks, Mauro