Commit 2283a117f65650352f2a9fd6b9af4cdbf5478d14
Committed by
Sam Ravnborg
1 parent
66da665ca3
Exists in
master
and in
7 other branches
[PATCH] scripts/kernel-doc: don't use uninitialized SRCTREE
Current kernel-doc (perl) script generates this warning: Use of uninitialized value in concatenation (.) or string at scripts/kernel-doc line 1668. So explicitly check for SRCTREE in the ENV before using it, and then if it is set, append a '/' to the end of it, otherwise the SRCTREE + filename can (will) be missing the intermediate '/'. Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Showing 1 changed file with 7 additions and 1 deletions Side-by-side Diff
scripts/kernel-doc
... | ... | @@ -1665,11 +1665,17 @@ |
1665 | 1665 | } |
1666 | 1666 | |
1667 | 1667 | sub process_file($) { |
1668 | - my ($file) = "$ENV{'SRCTREE'}@_"; | |
1668 | + my $file; | |
1669 | 1669 | my $identifier; |
1670 | 1670 | my $func; |
1671 | 1671 | my $initial_section_counter = $section_counter; |
1672 | 1672 | |
1673 | + if (defined($ENV{'SRCTREE'})) { | |
1674 | + $file = "$ENV{'SRCTREE'}" . "/" . "@_"; | |
1675 | + } | |
1676 | + else { | |
1677 | + $file = "@_"; | |
1678 | + } | |
1673 | 1679 | if (defined($source_map{$file})) { |
1674 | 1680 | $file = $source_map{$file}; |
1675 | 1681 | } |