Skip to content

Commit e8ebb85

Browse files
vegardJonathan Corbet
authored andcommitted
scripts/kernel-doc: simplify function printing
Get rid of the $start variable, since it's really not necessary. No functional change. Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com> Reviewed-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/20240215134828.1277109-3-vegard.nossum@oracle.com
1 parent a3a23d3 commit e8ebb85

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

scripts/kernel-doc

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,6 @@ sub output_function_rst(%) {
820820
my %args = %{$_[0]};
821821
my ($parameter, $section);
822822
my $oldprefix = $lineprefix;
823-
my $start = "";
824823
my $is_macro = 0;
825824

826825
if ($sphinx_major < 3) {
@@ -830,7 +829,7 @@ sub output_function_rst(%) {
830829
print " **Typedef**: ";
831830
$lineprefix = "";
832831
output_highlight_rst($args{'purpose'});
833-
$start = "\n\n**Syntax**\n\n ``";
832+
print "\n\n**Syntax**\n\n ``";
834833
$is_macro = 1;
835834
} else {
836835
print ".. c:function:: ";
@@ -848,17 +847,16 @@ sub output_function_rst(%) {
848847
print " **Typedef**: ";
849848
$lineprefix = "";
850849
output_highlight_rst($args{'purpose'});
851-
$start = "\n\n**Syntax**\n\n ``";
850+
print "\n\n**Syntax**\n\n ``";
852851
} else {
853852
print "``" if ($is_macro);
854853
}
855854
}
856855
if ($args{'functiontype'} ne "") {
857-
$start .= $args{'functiontype'} . " " . $args{'function'} . " (";
856+
print $args{'functiontype'} . " " . $args{'function'} . " (";
858857
} else {
859-
$start .= $args{'function'} . " (";
858+
print $args{'function'} . " (";
860859
}
861-
print $start;
862860

863861
my $count = 0;
864862
foreach my $parameter (@{$args{'parameterlist'}}) {

0 commit comments

Comments
 (0)