Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scripts/kernel-doc: remove an obscure logic from kernel-doc

Kernel-doc has an obscure logic that uses an external file
to map files via a .tmp_filelist.txt file stored at the current
directory. The rationale for such code predates git time,
as it was added on Kernel v2.4.5.5, with the following description:

# 26/05/2001 - Support for separate source and object trees.
# Return error code.
# Keith Owens <kaos@ocs.com.au>

from commit 396a6123577d ("v2.4.5.4 -> v2.4.5.5") at the historic
tree:
https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/

Support for separate source and object trees is now done on a different
way via make O=<object>.

There's no logic to create such file, so it sounds to me that this is
just dead code.

So, drop it.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/fd3b28dec36ba1668325d6770d4c4754414337fc.1739340170.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Corbet <corbet@lwn.net>

authored by

Mauro Carvalho Chehab and committed by
Jonathan Corbet
ba561b48 b09d96e0

+1 -18
+1 -18
scripts/kernel-doc
··· 179 179 my %nosymbol_table = (); 180 180 my $declaration_start_line; 181 181 my ($type, $declaration_name, $return_type); 182 - my ($newsection, $newcontents, $prototype, $brcount, %source_map); 182 + my ($newsection, $newcontents, $prototype, $brcount); 183 183 184 184 if (defined($ENV{'KBUILD_VERBOSE'}) && $ENV{'KBUILD_VERBOSE'} =~ '1') { 185 185 $verbose = 1; ··· 2005 2005 $file = $orig_file; 2006 2006 } 2007 2007 2008 - if (defined($source_map{$file})) { 2009 - $file = $source_map{$file}; 2010 - } 2011 - 2012 2008 return $file; 2013 2009 } 2014 2010 ··· 2397 2401 my $result = $highlights[$k][1]; 2398 2402 # print STDERR "scanning pattern:$pattern, highlight:($result)\n"; 2399 2403 $dohighlight .= "\$contents =~ s:$pattern:$result:gs;\n"; 2400 - } 2401 - 2402 - # Read the file that maps relative names to absolute names for 2403 - # separate source and object directories and for shadow trees. 2404 - if (open(SOURCE_MAP, "<.tmp_filelist.txt")) { 2405 - my ($relname, $absname); 2406 - while(<SOURCE_MAP>) { 2407 - chop(); 2408 - ($relname, $absname) = (split())[0..1]; 2409 - $relname =~ s:^/+::; 2410 - $source_map{$relname} = $absname; 2411 - } 2412 - close(SOURCE_MAP); 2413 2404 } 2414 2405 2415 2406 if ($output_selection == OUTPUT_EXPORTED ||