kernel-doc (0d9c2ff1c9f7f8b339fc42ac9763b28c71f1c115) kernel-doc (5cb5c31cdf246099f7d48a57f448b05b7941cd6a)
1#!/usr/bin/env perl
2
3use warnings;
4use strict;
5
6## Copyright (c) 1998 Michael Zucchi, All Rights Reserved ##
7## Copyright (C) 2000, 1 Tim Waugh <twaugh@redhat.com> ##
8## Copyright (C) 2001 Simon Huggins ##

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

2163}
2164
2165sub dump_struct($$) {
2166 my $x = shift;
2167 my $file = shift;
2168 my $nested;
2169
2170 if ($x =~ /(struct|union)\s+(\w+)\s*{(.*)}/) {
1#!/usr/bin/env perl
2
3use warnings;
4use strict;
5
6## Copyright (c) 1998 Michael Zucchi, All Rights Reserved ##
7## Copyright (C) 2000, 1 Tim Waugh <twaugh@redhat.com> ##
8## Copyright (C) 2001 Simon Huggins ##

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

2163}
2164
2165sub dump_struct($$) {
2166 my $x = shift;
2167 my $file = shift;
2168 my $nested;
2169
2170 if ($x =~ /(struct|union)\s+(\w+)\s*{(.*)}/) {
2171 #my $decl_type = $1;
2171 my $decl_type = $1;
2172 $declaration_name = $2;
2173 my $members = $3;
2174
2175 # ignore embedded structs or unions
2176 $members =~ s/({.*})//g;
2177 $nested = $1;
2178
2179 # ignore members marked private:

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

2189 $members =~ s/__aligned\s*\([^;]*\)//gos;
2190 $members =~ s/\s*CRYPTO_MINALIGN_ATTR//gos;
2191 # replace DECLARE_BITMAP
2192 $members =~ s/DECLARE_BITMAP\s*\(([^,)]+), ([^,)]+)\)/unsigned long $1\[BITS_TO_LONGS($2)\]/gos;
2193 # replace DECLARE_HASHTABLE
2194 $members =~ s/DECLARE_HASHTABLE\s*\(([^,)]+), ([^,)]+)\)/unsigned long $1\[1 << (($2) - 1)\]/gos;
2195
2196 create_parameterlist($members, ';', $file);
2172 $declaration_name = $2;
2173 my $members = $3;
2174
2175 # ignore embedded structs or unions
2176 $members =~ s/({.*})//g;
2177 $nested = $1;
2178
2179 # ignore members marked private:

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

2189 $members =~ s/__aligned\s*\([^;]*\)//gos;
2190 $members =~ s/\s*CRYPTO_MINALIGN_ATTR//gos;
2191 # replace DECLARE_BITMAP
2192 $members =~ s/DECLARE_BITMAP\s*\(([^,)]+), ([^,)]+)\)/unsigned long $1\[BITS_TO_LONGS($2)\]/gos;
2193 # replace DECLARE_HASHTABLE
2194 $members =~ s/DECLARE_HASHTABLE\s*\(([^,)]+), ([^,)]+)\)/unsigned long $1\[1 << (($2) - 1)\]/gos;
2195
2196 create_parameterlist($members, ';', $file);
2197 check_sections($file, $declaration_name, "struct", $sectcheck, $struct_actual, $nested);
2197 check_sections($file, $declaration_name, $decl_type, $sectcheck, $struct_actual, $nested);
2198
2199 output_declaration($declaration_name,
2200 'struct',
2201 {'struct' => $declaration_name,
2202 'module' => $modulename,
2203 'parameterlist' => \@parameterlist,
2204 'parameterdescs' => \%parameterdescs,
2205 'parametertypes' => \%parametertypes,

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

2221
2222 $x =~ s@/\*.*?\*/@@gos; # strip comments.
2223 # strip #define macros inside enums
2224 $x =~ s@#\s*((define|ifdef)\s+|endif)[^;]*;@@gos;
2225
2226 if ($x =~ /enum\s+(\w+)\s*{(.*)}/) {
2227 $declaration_name = $1;
2228 my $members = $2;
2198
2199 output_declaration($declaration_name,
2200 'struct',
2201 {'struct' => $declaration_name,
2202 'module' => $modulename,
2203 'parameterlist' => \@parameterlist,
2204 'parameterdescs' => \%parameterdescs,
2205 'parametertypes' => \%parametertypes,

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

2221
2222 $x =~ s@/\*.*?\*/@@gos; # strip comments.
2223 # strip #define macros inside enums
2224 $x =~ s@#\s*((define|ifdef)\s+|endif)[^;]*;@@gos;
2225
2226 if ($x =~ /enum\s+(\w+)\s*{(.*)}/) {
2227 $declaration_name = $1;
2228 my $members = $2;
2229 my %_members;
2230
2229 $members =~ s/\s+$//;
2230
2231 foreach my $arg (split ',', $members) {
2232 $arg =~ s/^\s*(\w+).*/$1/;
2233 push @parameterlist, $arg;
2234 if (!$parameterdescs{$arg}) {
2235 $parameterdescs{$arg} = $undescribed;
2236 print STDERR "${file}:$.: warning: Enum value '$arg' ".
2237 "not described in enum '$declaration_name'\n";
2238 }
2231 $members =~ s/\s+$//;
2232
2233 foreach my $arg (split ',', $members) {
2234 $arg =~ s/^\s*(\w+).*/$1/;
2235 push @parameterlist, $arg;
2236 if (!$parameterdescs{$arg}) {
2237 $parameterdescs{$arg} = $undescribed;
2238 print STDERR "${file}:$.: warning: Enum value '$arg' ".
2239 "not described in enum '$declaration_name'\n";
2240 }
2239
2241 $_members{$arg} = 1;
2240 }
2241
2242 }
2243
2244 while (my ($k, $v) = each %parameterdescs) {
2245 if (!exists($_members{$k})) {
2246 print STDERR "${file}:$.: warning: Excess enum value " .
2247 "'$k' description in '$declaration_name'\n";
2248 }
2249 }
2250
2242 output_declaration($declaration_name,
2243 'enum',
2244 {'enum' => $declaration_name,
2245 'module' => $modulename,
2246 'parameterlist' => \@parameterlist,
2247 'parameterdescs' => \%parameterdescs,
2248 'sectionlist' => \@sectionlist,
2249 'sections' => \%sections,

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

2501 print STDERR "${file}:$.: warning: " .
2502 "Excess function parameter " .
2503 "'$sects[$sx]' " .
2504 "description in '$decl_name'\n";
2505 ++$warnings;
2506 } else {
2507 if ($nested !~ m/\Q$sects[$sx]\E/) {
2508 print STDERR "${file}:$.: warning: " .
2251 output_declaration($declaration_name,
2252 'enum',
2253 {'enum' => $declaration_name,
2254 'module' => $modulename,
2255 'parameterlist' => \@parameterlist,
2256 'parameterdescs' => \%parameterdescs,
2257 'sectionlist' => \@sectionlist,
2258 'sections' => \%sections,

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

2510 print STDERR "${file}:$.: warning: " .
2511 "Excess function parameter " .
2512 "'$sects[$sx]' " .
2513 "description in '$decl_name'\n";
2514 ++$warnings;
2515 } else {
2516 if ($nested !~ m/\Q$sects[$sx]\E/) {
2517 print STDERR "${file}:$.: warning: " .
2509 "Excess struct/union/enum/typedef member " .
2518 "Excess $decl_type member " .
2510 "'$sects[$sx]' " .
2511 "description in '$decl_name'\n";
2512 ++$warnings;
2513 }
2514 }
2515 }
2516 }
2517}

--- 704 unchanged lines hidden ---
2519 "'$sects[$sx]' " .
2520 "description in '$decl_name'\n";
2521 ++$warnings;
2522 }
2523 }
2524 }
2525 }
2526}

--- 704 unchanged lines hidden ---