kernel-doc (9b838a3c32d7a1edd7edeec1bc455eca76622218) kernel-doc (a746fe32cd362c8bba523a97123129ede4f5b75a)
1#!/usr/bin/env perl
2# SPDX-License-Identifier: GPL-2.0
3
4use warnings;
5use strict;
6
7## Copyright (c) 1998 Michael Zucchi, All Rights Reserved ##
8## Copyright (C) 2000, 1 Tim Waugh <twaugh@redhat.com> ##

--- 1187 unchanged lines hidden (view full) ---

1196
1197sub dump_union($$) {
1198 dump_struct(@_);
1199}
1200
1201sub dump_struct($$) {
1202 my $x = shift;
1203 my $file = shift;
1#!/usr/bin/env perl
2# SPDX-License-Identifier: GPL-2.0
3
4use warnings;
5use strict;
6
7## Copyright (c) 1998 Michael Zucchi, All Rights Reserved ##
8## Copyright (C) 2000, 1 Tim Waugh <twaugh@redhat.com> ##

--- 1187 unchanged lines hidden (view full) ---

1196
1197sub dump_union($$) {
1198 dump_struct(@_);
1199}
1200
1201sub dump_struct($$) {
1202 my $x = shift;
1203 my $file = shift;
1204 my $decl_type;
1205 my $members;
1206 my $type = qr{struct|union};
1207 # For capturing struct/union definition body, i.e. "{members*}qualifiers*"
1208 my $definition_body = qr{\{(.*)\}(?:\s*(?:__packed|__aligned|____cacheline_aligned_in_smp|____cacheline_aligned|__attribute__\s*\(\([a-z0-9,_\s\(\)]*\)\)))*};
1204
1209
1205 if ($x =~ /(struct|union)\s+(\w+)\s*\{(.*)\}(\s*(__packed|__aligned|____cacheline_aligned_in_smp|____cacheline_aligned|__attribute__\s*\(\([a-z0-9,_\s\(\)]*\)\)))*/) {
1206 my $decl_type = $1;
1210 if ($x =~ /($type)\s+(\w+)\s*$definition_body/) {
1211 $decl_type = $1;
1207 $declaration_name = $2;
1212 $declaration_name = $2;
1208 my $members = $3;
1213 $members = $3;
1214 } elsif ($x =~ /typedef\s+($type)\s*$definition_body\s*(\w+)\s*;/) {
1215 $decl_type = $1;
1216 $declaration_name = $3;
1217 $members = $2;
1218 }
1209
1219
1220 if ($members) {
1210 if ($identifier ne $declaration_name) {
1211 print STDERR "${file}:$.: warning: expecting prototype for $decl_type $identifier. Prototype was for $decl_type $declaration_name instead\n";
1212 return;
1213 }
1214
1215 # ignore members marked private:
1216 $members =~ s/\/\*\s*private:.*?\/\*\s*public:.*?\*\///gosi;
1217 $members =~ s/\/\*\s*private:.*//gosi;

--- 1253 unchanged lines hidden ---
1221 if ($identifier ne $declaration_name) {
1222 print STDERR "${file}:$.: warning: expecting prototype for $decl_type $identifier. Prototype was for $decl_type $declaration_name instead\n";
1223 return;
1224 }
1225
1226 # ignore members marked private:
1227 $members =~ s/\/\*\s*private:.*?\/\*\s*public:.*?\*\///gosi;
1228 $members =~ s/\/\*\s*private:.*//gosi;

--- 1253 unchanged lines hidden ---