kernel-doc (a40a8a1103051610fdee3d121a50ced09bcc1c54) kernel-doc (3080ea5553cc909b000d1f1d964a9041962f2c5b)
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> ##

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

1240 $members =~ s/\/\*.*?\*\///gos;
1241 # strip attributes
1242 $members =~ s/\s*$attribute/ /gi;
1243 $members =~ s/\s*__aligned\s*\([^;]*\)/ /gos;
1244 $members =~ s/\s*__packed\s*/ /gos;
1245 $members =~ s/\s*CRYPTO_MINALIGN_ATTR/ /gos;
1246 $members =~ s/\s*____cacheline_aligned_in_smp/ /gos;
1247 $members =~ s/\s*____cacheline_aligned/ /gos;
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> ##

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

1240 $members =~ s/\/\*.*?\*\///gos;
1241 # strip attributes
1242 $members =~ s/\s*$attribute/ /gi;
1243 $members =~ s/\s*__aligned\s*\([^;]*\)/ /gos;
1244 $members =~ s/\s*__packed\s*/ /gos;
1245 $members =~ s/\s*CRYPTO_MINALIGN_ATTR/ /gos;
1246 $members =~ s/\s*____cacheline_aligned_in_smp/ /gos;
1247 $members =~ s/\s*____cacheline_aligned/ /gos;
1248 # unwrap struct_group():
1249 # - first eat non-declaration parameters and rewrite for final match
1250 # - then remove macro, outer parens, and trailing semicolon
1251 $members =~ s/\bstruct_group\s*\(([^,]*,)/STRUCT_GROUP(/gos;
1252 $members =~ s/\bstruct_group_(attr|tagged)\s*\(([^,]*,){2}/STRUCT_GROUP(/gos;
1253 $members =~ s/\b__struct_group\s*\(([^,]*,){3}/STRUCT_GROUP(/gos;
1254 $members =~ s/\bSTRUCT_GROUP(\(((?:(?>[^)(]+)|(?1))*)\))[^;]*;/$2/gos;
1248
1249 my $args = qr{([^,)]+)};
1250 # replace DECLARE_BITMAP
1251 $members =~ s/__ETHTOOL_DECLARE_LINK_MODE_MASK\s*\(([^\)]+)\)/DECLARE_BITMAP($1, __ETHTOOL_LINK_MODE_MASK_NBITS)/gos;
1252 $members =~ s/DECLARE_BITMAP\s*\($args,\s*$args\)/unsigned long $1\[BITS_TO_LONGS($2)\]/gos;
1253 # replace DECLARE_HASHTABLE
1254 $members =~ s/DECLARE_HASHTABLE\s*\($args,\s*$args\)/unsigned long $1\[1 << (($2) - 1)\]/gos;
1255 # replace DECLARE_KFIFO
1256 $members =~ s/DECLARE_KFIFO\s*\($args,\s*$args,\s*$args\)/$2 \*$1/gos;
1257 # replace DECLARE_KFIFO_PTR
1258 $members =~ s/DECLARE_KFIFO_PTR\s*\($args,\s*$args\)/$2 \*$1/gos;
1255
1256 my $args = qr{([^,)]+)};
1257 # replace DECLARE_BITMAP
1258 $members =~ s/__ETHTOOL_DECLARE_LINK_MODE_MASK\s*\(([^\)]+)\)/DECLARE_BITMAP($1, __ETHTOOL_LINK_MODE_MASK_NBITS)/gos;
1259 $members =~ s/DECLARE_BITMAP\s*\($args,\s*$args\)/unsigned long $1\[BITS_TO_LONGS($2)\]/gos;
1260 # replace DECLARE_HASHTABLE
1261 $members =~ s/DECLARE_HASHTABLE\s*\($args,\s*$args\)/unsigned long $1\[1 << (($2) - 1)\]/gos;
1262 # replace DECLARE_KFIFO
1263 $members =~ s/DECLARE_KFIFO\s*\($args,\s*$args,\s*$args\)/$2 \*$1/gos;
1264 # replace DECLARE_KFIFO_PTR
1265 $members =~ s/DECLARE_KFIFO_PTR\s*\($args,\s*$args\)/$2 \*$1/gos;
1266 # replace DECLARE_FLEX_ARRAY
1267 $members =~ s/(?:__)?DECLARE_FLEX_ARRAY\s*\($args,\s*$args\)/$1 $2\[\]/gos;
1259 my $declaration = $members;
1260
1261 # Split nested struct/union elements as newer ones
1262 while ($members =~ m/$struct_members/) {
1263 my $newmember;
1264 my $maintype = $1;
1265 my $ids = $4;
1266 my $content = $3;

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

1784 $prototype =~ s/__init_or_module +//;
1785 $prototype =~ s/__deprecated +//;
1786 $prototype =~ s/__flatten +//;
1787 $prototype =~ s/__meminit +//;
1788 $prototype =~ s/__must_check +//;
1789 $prototype =~ s/__weak +//;
1790 $prototype =~ s/__sched +//;
1791 $prototype =~ s/__printf\s*\(\s*\d*\s*,\s*\d*\s*\) +//;
1268 my $declaration = $members;
1269
1270 # Split nested struct/union elements as newer ones
1271 while ($members =~ m/$struct_members/) {
1272 my $newmember;
1273 my $maintype = $1;
1274 my $ids = $4;
1275 my $content = $3;

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

1793 $prototype =~ s/__init_or_module +//;
1794 $prototype =~ s/__deprecated +//;
1795 $prototype =~ s/__flatten +//;
1796 $prototype =~ s/__meminit +//;
1797 $prototype =~ s/__must_check +//;
1798 $prototype =~ s/__weak +//;
1799 $prototype =~ s/__sched +//;
1800 $prototype =~ s/__printf\s*\(\s*\d*\s*,\s*\d*\s*\) +//;
1792 $prototype =~ s/__alloc_size\s*\(\s*\d+\s*(?:,\s*\d+\s*)?\) +//;
1793 my $define = $prototype =~ s/^#\s*define\s+//; #ak added
1794 $prototype =~ s/__attribute_const__ +//;
1795 $prototype =~ s/__attribute__\s*\(\(
1796 (?:
1797 [\w\s]++ # attribute name
1798 (?:\([^)]*+\))? # attribute arguments
1799 \s*+,? # optional comma at the end
1800 )+

--- 713 unchanged lines hidden ---
1801 my $define = $prototype =~ s/^#\s*define\s+//; #ak added
1802 $prototype =~ s/__attribute_const__ +//;
1803 $prototype =~ s/__attribute__\s*\(\(
1804 (?:
1805 [\w\s]++ # attribute name
1806 (?:\([^)]*+\))? # attribute arguments
1807 \s*+,? # optional comma at the end
1808 )+

--- 713 unchanged lines hidden ---