diff mbox series

multipath-tools: refresh kernel-doc from kernel sources

Message ID 20180818203852.15230-1-xose.vazquez@gmail.com (mailing list archive)
State Not Applicable, archived
Delegated to: christophe varoqui
Headers show
Series multipath-tools: refresh kernel-doc from kernel sources | expand

Commit Message

Xose Vazquez Perez Aug. 18, 2018, 8:38 p.m. UTC
Cc: Gris Ge <fge@redhat.com>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: DM-DEV ML <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
---
 libdmmp/docs/kernel-doc | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

Comments

Xose Vazquez Perez Oct. 7, 2018, 12:14 p.m. UTC | #1
This one is missing.

On 8/18/18 10:38 PM, Xose Vazquez Perez wrote:
> Cc: Gris Ge <fge@redhat.com>
> Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
> Cc: DM-DEV ML <dm-devel@redhat.com>
> Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
> ---
>  libdmmp/docs/kernel-doc | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/libdmmp/docs/kernel-doc b/libdmmp/docs/kernel-doc
> index 0057d8e..8f0f508 100755
> --- a/libdmmp/docs/kernel-doc
> +++ b/libdmmp/docs/kernel-doc
> @@ -1062,7 +1062,7 @@ sub dump_struct($$) {
>      my $x = shift;
>      my $file = shift;
>  
> -    if ($x =~ /(struct|union)\s+(\w+)\s*{(.*)}/) {
> +    if ($x =~ /(struct|union)\s+(\w+)\s*\{(.*)\}/) {
>  	my $decl_type = $1;
>  	$declaration_name = $2;
>  	my $members = $3;
> @@ -1148,20 +1148,20 @@ sub dump_struct($$) {
>  				}
>  			}
>  		}
> -		$members =~ s/(struct|union)([^\{\};]+)\{([^\{\}]*)}([^\{\}\;]*)\;/$newmember/;
> +		$members =~ s/(struct|union)([^\{\};]+)\{([^\{\}]*)\}([^\{\}\;]*)\;/$newmember/;
>  	}
>  
>  	# Ignore other nested elements, like enums
> -	$members =~ s/({[^\{\}]*})//g;
> +	$members =~ s/(\{[^\{\}]*\})//g;
>  
>  	create_parameterlist($members, ';', $file, $declaration_name);
>  	check_sections($file, $declaration_name, $decl_type, $sectcheck, $struct_actual);
>  
>  	# Adjust declaration for better display
> -	$declaration =~ s/([{;])/$1\n/g;
> -	$declaration =~ s/}\s+;/};/g;
> +	$declaration =~ s/([\{;])/$1\n/g;
> +	$declaration =~ s/\}\s+;/};/g;
>  	# Better handle inlined enums
> -	do {} while ($declaration =~ s/(enum\s+{[^}]+),([^\n])/$1,\n$2/);
> +	do {} while ($declaration =~ s/(enum\s+\{[^\}]+),([^\n])/$1,\n$2/);
>  
>  	my @def_args = split /\n/, $declaration;
>  	my $level = 1;
> @@ -1171,12 +1171,12 @@ sub dump_struct($$) {
>  		$clause =~ s/\s+$//;
>  		$clause =~ s/\s+/ /;
>  		next if (!$clause);
> -		$level-- if ($clause =~ m/(})/ && $level > 1);
> +		$level-- if ($clause =~ m/(\})/ && $level > 1);
>  		if (!($clause =~ m/^\s*#/)) {
>  			$declaration .= "\t" x $level;
>  		}
>  		$declaration .= "\t" . $clause . "\n";
> -		$level++ if ($clause =~ m/({)/ && !($clause =~m/}/));
> +		$level++ if ($clause =~ m/(\{)/ && !($clause =~m/\}/));
>  	}
>  	output_declaration($declaration_name,
>  			   'struct',
> @@ -1244,7 +1244,7 @@ sub dump_enum($$) {
>      # strip #define macros inside enums
>      $x =~ s@#\s*((define|ifdef)\s+|endif)[^;]*;@@gos;
>  
> -    if ($x =~ /enum\s+(\w+)\s*{(.*)}/) {
> +    if ($x =~ /enum\s+(\w+)\s*\{(.*)\}/) {
>  	$declaration_name = $1;
>  	my $members = $2;
>  	my %_members;
> @@ -1785,7 +1785,7 @@ sub process_proto_type($$) {
>      }
>  
>      while (1) {
> -	if ( $x =~ /([^{};]*)([{};])(.*)/ ) {
> +	if ( $x =~ /([^\{\};]*)([\{\};])(.*)/ ) {
>              if( length $prototype ) {
>                  $prototype .= " "
>              }
> 

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
Martin Wilck Oct. 24, 2018, 9:37 a.m. UTC | #2
On Sat, 2018-08-18 at 22:38 +0200, Xose Vazquez Perez wrote:
> Cc: Gris Ge <fge@redhat.com>
> Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
> Cc: DM-DEV ML <dm-devel@redhat.com>
> Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
> ---
>  libdmmp/docs/kernel-doc | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)

Reviewed-by: Martin Wilck <mwilck@suse.com>

... although I'd rather get rid of this script in the multipath-tools
tree altogether. People who build multipath-tools can be expected to be
able to procure an up-to-date kernel-doc script from the kernel tree.

In general, I'd appreciate if the kernel commit would be quoted or at
least referenced the commit message of patches like this.

Martin
diff mbox series

Patch

diff --git a/libdmmp/docs/kernel-doc b/libdmmp/docs/kernel-doc
index 0057d8e..8f0f508 100755
--- a/libdmmp/docs/kernel-doc
+++ b/libdmmp/docs/kernel-doc
@@ -1062,7 +1062,7 @@  sub dump_struct($$) {
     my $x = shift;
     my $file = shift;
 
-    if ($x =~ /(struct|union)\s+(\w+)\s*{(.*)}/) {
+    if ($x =~ /(struct|union)\s+(\w+)\s*\{(.*)\}/) {
 	my $decl_type = $1;
 	$declaration_name = $2;
 	my $members = $3;
@@ -1148,20 +1148,20 @@  sub dump_struct($$) {
 				}
 			}
 		}
-		$members =~ s/(struct|union)([^\{\};]+)\{([^\{\}]*)}([^\{\}\;]*)\;/$newmember/;
+		$members =~ s/(struct|union)([^\{\};]+)\{([^\{\}]*)\}([^\{\}\;]*)\;/$newmember/;
 	}
 
 	# Ignore other nested elements, like enums
-	$members =~ s/({[^\{\}]*})//g;
+	$members =~ s/(\{[^\{\}]*\})//g;
 
 	create_parameterlist($members, ';', $file, $declaration_name);
 	check_sections($file, $declaration_name, $decl_type, $sectcheck, $struct_actual);
 
 	# Adjust declaration for better display
-	$declaration =~ s/([{;])/$1\n/g;
-	$declaration =~ s/}\s+;/};/g;
+	$declaration =~ s/([\{;])/$1\n/g;
+	$declaration =~ s/\}\s+;/};/g;
 	# Better handle inlined enums
-	do {} while ($declaration =~ s/(enum\s+{[^}]+),([^\n])/$1,\n$2/);
+	do {} while ($declaration =~ s/(enum\s+\{[^\}]+),([^\n])/$1,\n$2/);
 
 	my @def_args = split /\n/, $declaration;
 	my $level = 1;
@@ -1171,12 +1171,12 @@  sub dump_struct($$) {
 		$clause =~ s/\s+$//;
 		$clause =~ s/\s+/ /;
 		next if (!$clause);
-		$level-- if ($clause =~ m/(})/ && $level > 1);
+		$level-- if ($clause =~ m/(\})/ && $level > 1);
 		if (!($clause =~ m/^\s*#/)) {
 			$declaration .= "\t" x $level;
 		}
 		$declaration .= "\t" . $clause . "\n";
-		$level++ if ($clause =~ m/({)/ && !($clause =~m/}/));
+		$level++ if ($clause =~ m/(\{)/ && !($clause =~m/\}/));
 	}
 	output_declaration($declaration_name,
 			   'struct',
@@ -1244,7 +1244,7 @@  sub dump_enum($$) {
     # strip #define macros inside enums
     $x =~ s@#\s*((define|ifdef)\s+|endif)[^;]*;@@gos;
 
-    if ($x =~ /enum\s+(\w+)\s*{(.*)}/) {
+    if ($x =~ /enum\s+(\w+)\s*\{(.*)\}/) {
 	$declaration_name = $1;
 	my $members = $2;
 	my %_members;
@@ -1785,7 +1785,7 @@  sub process_proto_type($$) {
     }
 
     while (1) {
-	if ( $x =~ /([^{};]*)([{};])(.*)/ ) {
+	if ( $x =~ /([^\{\};]*)([\{\};])(.*)/ ) {
             if( length $prototype ) {
                 $prototype .= " "
             }