]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
scripts/kernel-doc: simplify function printing
authorVegard Nossum <vegard.nossum@oracle.com>
Thu, 15 Feb 2024 13:48:25 +0000 (14:48 +0100)
committerJonathan Corbet <corbet@lwn.net>
Wed, 21 Feb 2024 20:44:21 +0000 (13:44 -0700)
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
scripts/kernel-doc

index 4dc5c3909d8c421c9b08af9644b384c3d3032baa..9b7441e776697fdb12cb41ed97954f5e32cf339c 100755 (executable)
@@ -820,7 +820,6 @@ sub output_function_rst(%) {
     my %args = %{$_[0]};
     my ($parameter, $section);
     my $oldprefix = $lineprefix;
-    my $start = "";
     my $is_macro = 0;
 
     if ($sphinx_major < 3) {
@@ -830,7 +829,7 @@ sub output_function_rst(%) {
             print "   **Typedef**: ";
             $lineprefix = "";
             output_highlight_rst($args{'purpose'});
-            $start = "\n\n**Syntax**\n\n  ``";
+            print "\n\n**Syntax**\n\n  ``";
             $is_macro = 1;
         } else {
             print ".. c:function:: ";
@@ -848,17 +847,16 @@ sub output_function_rst(%) {
             print "   **Typedef**: ";
             $lineprefix = "";
             output_highlight_rst($args{'purpose'});
-            $start = "\n\n**Syntax**\n\n  ``";
+            print "\n\n**Syntax**\n\n  ``";
         } else {
             print "``" if ($is_macro);
         }
     }
     if ($args{'functiontype'} ne "") {
-        $start .= $args{'functiontype'} . " " . $args{'function'} . " (";
+        print $args{'functiontype'} . " " . $args{'function'} . " (";
     } else {
-        $start .= $args{'function'} . " (";
+        print $args{'function'} . " (";
     }
-    print $start;
 
     my $count = 0;
     foreach my $parameter (@{$args{'parameterlist'}}) {