kernel-doc (009ef05f98129aa91c62c3baab859ba593a15bb2) kernel-doc (084aa00162bda02bcab501c2b0a0ea9252d291b2)
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;

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

1750 $prototype =~ s/^asmlinkage +//;
1751 $prototype =~ s/^inline +//;
1752 $prototype =~ s/^__inline__ +//;
1753 $prototype =~ s/^__inline +//;
1754 $prototype =~ s/^__always_inline +//;
1755 $prototype =~ s/^noinline +//;
1756 $prototype =~ s/__init +//;
1757 $prototype =~ s/__init_or_module +//;
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;

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

1761 $prototype =~ s/^asmlinkage +//;
1762 $prototype =~ s/^inline +//;
1763 $prototype =~ s/^__inline__ +//;
1764 $prototype =~ s/^__inline +//;
1765 $prototype =~ s/^__always_inline +//;
1766 $prototype =~ s/^noinline +//;
1767 $prototype =~ s/__init +//;
1768 $prototype =~ s/__init_or_module +//;
1769 $prototype =~ s/__flatten +//;
1758 $prototype =~ s/__meminit +//;
1759 $prototype =~ s/__must_check +//;
1760 $prototype =~ s/__weak +//;
1761 $prototype =~ s/__sched +//;
1762 $prototype =~ s/__printf\s*\(\s*\d*\s*,\s*\d*\s*\) +//;
1763 my $define = $prototype =~ s/^#\s*define\s+//; #ak added
1770 $prototype =~ s/__meminit +//;
1771 $prototype =~ s/__must_check +//;
1772 $prototype =~ s/__weak +//;
1773 $prototype =~ s/__sched +//;
1774 $prototype =~ s/__printf\s*\(\s*\d*\s*,\s*\d*\s*\) +//;
1775 my $define = $prototype =~ s/^#\s*define\s+//; #ak added
1776 $prototype =~ s/__attribute_const__ +//;
1764 $prototype =~ s/__attribute__\s*\(\(
1765 (?:
1766 [\w\s]++ # attribute name
1767 (?:\([^)]*+\))? # attribute arguments
1768 \s*+,? # optional comma at the end
1769 )+
1770 \)\)\s+//x;
1771

--- 699 unchanged lines hidden ---
1777 $prototype =~ s/__attribute__\s*\(\(
1778 (?:
1779 [\w\s]++ # attribute name
1780 (?:\([^)]*+\))? # attribute arguments
1781 \s*+,? # optional comma at the end
1782 )+
1783 \)\)\s+//x;
1784

--- 699 unchanged lines hidden ---