kernel-doc (3080ea5553cc909b000d1f1d964a9041962f2c5b) | kernel-doc (603bdf5d6c092eb05666decd84288dfda71eee90) |
---|---|
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; | |
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; | 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_PHY_INTERFACE_MASK\s*\(([^\)]+)\)/DECLARE_BITMAP($1, PHY_INTERFACE_MODE_MAX)/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; | 1253 $members =~ s/DECLARE_BITMAP\s*\($args,\s*$args\)/unsigned long $1\[BITS_TO_LONGS($2)\]/gos; 1254 # replace DECLARE_HASHTABLE 1255 $members =~ s/DECLARE_HASHTABLE\s*\($args,\s*$args\)/unsigned long $1\[1 << (($2) - 1)\]/gos; 1256 # replace DECLARE_KFIFO 1257 $members =~ s/DECLARE_KFIFO\s*\($args,\s*$args,\s*$args\)/$2 \*$1/gos; 1258 # replace DECLARE_KFIFO_PTR 1259 $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; | |
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*\) +//; | 1260 my $declaration = $members; 1261 1262 # Split nested struct/union elements as newer ones 1263 while ($members =~ m/$struct_members/) { 1264 my $newmember; 1265 my $maintype = $1; 1266 my $ids = $4; 1267 my $content = $3; --- 517 unchanged lines hidden (view full) --- 1785 $prototype =~ s/__init_or_module +//; 1786 $prototype =~ s/__deprecated +//; 1787 $prototype =~ s/__flatten +//; 1788 $prototype =~ s/__meminit +//; 1789 $prototype =~ s/__must_check +//; 1790 $prototype =~ s/__weak +//; 1791 $prototype =~ s/__sched +//; 1792 $prototype =~ s/__printf\s*\(\s*\d*\s*,\s*\d*\s*\) +//; |
1793 $prototype =~ s/__alloc_size\s*\(\s*\d+\s*(?:,\s*\d+\s*)?\) +//; |
|
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 --- | 1794 my $define = $prototype =~ s/^#\s*define\s+//; #ak added 1795 $prototype =~ s/__attribute_const__ +//; 1796 $prototype =~ s/__attribute__\s*\(\( 1797 (?: 1798 [\w\s]++ # attribute name 1799 (?:\([^)]*+\))? # attribute arguments 1800 \s*+,? # optional comma at the end 1801 )+ --- 713 unchanged lines hidden --- |