kernel-doc (b2fd6dbf25cba7d904b62b81639bca8678c901fa) kernel-doc (e34e7dbb35474ffc75f639eca64a18a15f4f8688)
1#!/usr/bin/perl -w
2
3use strict;
4
5## Copyright (c) 1998 Michael Zucchi, All Rights Reserved ##
6## Copyright (C) 2000, 1 Tim Waugh <twaugh@redhat.com> ##
7## Copyright (C) 2001 Simon Huggins ##
8## Copyright (C) 2005-2009 Randy Dunlap ##

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

1648 "described in '$declaration_name'\n";
1649 }
1650 print STDERR "Warning(${file}:$.):" .
1651 " No description found for parameter '$param'\n";
1652 ++$warnings;
1653 }
1654 }
1655
1#!/usr/bin/perl -w
2
3use strict;
4
5## Copyright (c) 1998 Michael Zucchi, All Rights Reserved ##
6## Copyright (C) 2000, 1 Tim Waugh <twaugh@redhat.com> ##
7## Copyright (C) 2001 Simon Huggins ##
8## Copyright (C) 2005-2009 Randy Dunlap ##

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

1648 "described in '$declaration_name'\n";
1649 }
1650 print STDERR "Warning(${file}:$.):" .
1651 " No description found for parameter '$param'\n";
1652 ++$warnings;
1653 }
1654 }
1655
1656 # strip spaces from $param so that it is one continous string
1657 # on @parameterlist;
1658 # this fixes a problem where check_sections() cannot find
1659 # a parameter like "addr[6 + 2]" because it actually appears
1660 # as "addr[6", "+", "2]" on the parameter list;
1661 # but it's better to maintain the param string unchanged for output,
1662 # so just weaken the string compare in check_sections() to ignore
1663 # "[blah" in a parameter string;
1664 ###$param =~ s/\s*//g;
1656 push @parameterlist, $param;
1657 $parametertypes{$param} = $type;
1658}
1659
1660sub check_sections($$$$$$) {
1661 my ($file, $decl_name, $decl_type, $sectcheck, $prmscheck, $nested) = @_;
1662 my @sects = split ' ', $sectcheck;
1663 my @prms = split ' ', $prmscheck;
1664 my $err;
1665 my ($px, $sx);
1666 my $prm_clean; # strip trailing "[array size]" and/or beginning "*"
1667
1668 foreach $sx (0 .. $#sects) {
1669 $err = 1;
1670 foreach $px (0 .. $#prms) {
1671 $prm_clean = $prms[$px];
1672 $prm_clean =~ s/\[.*\]//;
1673 $prm_clean =~ s/__attribute__\s*\(\([a-z,_\*\s\(\)]*\)\)//;
1665 push @parameterlist, $param;
1666 $parametertypes{$param} = $type;
1667}
1668
1669sub check_sections($$$$$$) {
1670 my ($file, $decl_name, $decl_type, $sectcheck, $prmscheck, $nested) = @_;
1671 my @sects = split ' ', $sectcheck;
1672 my @prms = split ' ', $prmscheck;
1673 my $err;
1674 my ($px, $sx);
1675 my $prm_clean; # strip trailing "[array size]" and/or beginning "*"
1676
1677 foreach $sx (0 .. $#sects) {
1678 $err = 1;
1679 foreach $px (0 .. $#prms) {
1680 $prm_clean = $prms[$px];
1681 $prm_clean =~ s/\[.*\]//;
1682 $prm_clean =~ s/__attribute__\s*\(\([a-z,_\*\s\(\)]*\)\)//;
1683 # ignore array size in a parameter string;
1684 # however, the original param string may contain
1685 # spaces, e.g.: addr[6 + 2]
1686 # and this appears in @prms as "addr[6" since the
1687 # parameter list is split at spaces;
1688 # hence just ignore "[..." for the sections check;
1689 $prm_clean =~ s/\[.*//;
1690
1674 ##$prm_clean =~ s/^\**//;
1675 if ($prm_clean eq $sects[$sx]) {
1676 $err = 0;
1677 last;
1678 }
1679 }
1680 if ($err) {
1681 if ($decl_type eq "function") {

--- 520 unchanged lines hidden ---
1691 ##$prm_clean =~ s/^\**//;
1692 if ($prm_clean eq $sects[$sx]) {
1693 $err = 0;
1694 last;
1695 }
1696 }
1697 if ($err) {
1698 if ($decl_type eq "function") {

--- 520 unchanged lines hidden ---