lkml.org 
[lkml]   [2022]   [Mar]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/4] scripts/get_feat.pl: allow output the parsed file names
Em Fri, 25 Mar 2022 13:19:28 -0600
Jonathan Corbet <corbet@lwn.net> escreveu:

> Mauro Carvalho Chehab <mchehab@kernel.org> 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 <mchehab@kernel.org>
>
> 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";

Thanks,
Mauro

\
 
 \ /
  Last update: 2022-03-26 00:26    [W:0.433 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site