Commit 632ce137 authored by Jason Gunthorpe's avatar Jason Gunthorpe

scripts/kernel-doc: support EXPORT_SYMBOL_NS_GPL() with -export

Parse EXPORT_SYMBOL_NS_GPL() in addition to EXPORT_SYMBOL_GPL() for use
with the -export flag.

Link: https://lore.kernel.org/r/4-v6-a196d26f289e+11787-iommufd_jgg@nvidia.comAcked-by: default avatarJonathan Corbet <corbet@lwn.net>
Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
parent 5fe93786
...@@ -256,6 +256,7 @@ my $doc_inline_sect = '\s*\*\s*(@\s*[\w][\w\.]*\s*):(.*)'; ...@@ -256,6 +256,7 @@ my $doc_inline_sect = '\s*\*\s*(@\s*[\w][\w\.]*\s*):(.*)';
my $doc_inline_end = '^\s*\*/\s*$'; my $doc_inline_end = '^\s*\*/\s*$';
my $doc_inline_oneline = '^\s*/\*\*\s*(@[\w\s]+):\s*(.*)\s*\*/\s*$'; my $doc_inline_oneline = '^\s*/\*\*\s*(@[\w\s]+):\s*(.*)\s*\*/\s*$';
my $export_symbol = '^\s*EXPORT_SYMBOL(_GPL)?\s*\(\s*(\w+)\s*\)\s*;'; my $export_symbol = '^\s*EXPORT_SYMBOL(_GPL)?\s*\(\s*(\w+)\s*\)\s*;';
my $export_symbol_ns = '^\s*EXPORT_SYMBOL_NS(_GPL)?\s*\(\s*(\w+)\s*,\s*\w+\)\s*;';
my $function_pointer = qr{([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)}; my $function_pointer = qr{([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)};
my $attribute = qr{__attribute__\s*\(\([a-z0-9,_\*\s\(\)]*\)\)}i; my $attribute = qr{__attribute__\s*\(\([a-z0-9,_\*\s\(\)]*\)\)}i;
...@@ -1948,6 +1949,10 @@ sub process_export_file($) { ...@@ -1948,6 +1949,10 @@ sub process_export_file($) {
next if (defined($nosymbol_table{$2})); next if (defined($nosymbol_table{$2}));
$function_table{$2} = 1; $function_table{$2} = 1;
} }
if (/$export_symbol_ns/) {
next if (defined($nosymbol_table{$2}));
$function_table{$2} = 1;
}
} }
close(IN); close(IN);
...@@ -2419,12 +2424,12 @@ found on PATH. ...@@ -2419,12 +2424,12 @@ found on PATH.
=item -export =item -export
Only output documentation for the symbols that have been exported using Only output documentation for the symbols that have been exported using
EXPORT_SYMBOL() or EXPORT_SYMBOL_GPL() in any input FILE or -export-file FILE. EXPORT_SYMBOL() and related macros in any input FILE or -export-file FILE.
=item -internal =item -internal
Only output documentation for the symbols that have NOT been exported using Only output documentation for the symbols that have NOT been exported using
EXPORT_SYMBOL() or EXPORT_SYMBOL_GPL() in any input FILE or -export-file FILE. EXPORT_SYMBOL() and related macros in any input FILE or -export-file FILE.
=item -function NAME =item -function NAME
...@@ -2451,8 +2456,7 @@ Do not output DOC: sections. ...@@ -2451,8 +2456,7 @@ Do not output DOC: sections.
=item -export-file FILE =item -export-file FILE
Specify an additional FILE in which to look for EXPORT_SYMBOL() and Specify an additional FILE in which to look for EXPORT_SYMBOL information.
EXPORT_SYMBOL_GPL().
To be used with -export or -internal. To be used with -export or -internal.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment