History

docs: kdoc_parser: add data/function attributes to ignore

Recognize and ignore __rcu (in struct members), __private (in struct members), and __always_unused (in function parameters) to prevent kernel-doc warnings: Warning: include/linux/rethook.h:38 struct member 'void (__rcu *handler' not described in 'rethook' Warning: include/linux/hrtimer_types.h:47 Invalid param: enum hrtimer_restart (*__private function)(struct hrtimer *) Warning: security/ipe/hooks.c:81 function parameter '__always_unused' not described in 'ipe_mmap_file' Warning: security/ipe/hooks.c:109 function parameter '__always_unused' not described in 'ipe_file_mprotect' There are more of these (in compiler_types.h, compiler_attributes.h) that can be added as needed.

Randy Dunlap committed 11 months ago

Commit 2006f461 parent 4d23db51 file · +3 −0Browse files

Showing the changes to tools/lib/python (1 of 1 file). Show all

Unified · Split

tools/lib/python/kdoc/kdoc_parser.py+3−0
@@ -86,6 +86,8 @@ struct_xforms = [ · 85 unmodified lines
8686 (KernRe(r'\s*__counted_by_(le|be)\s*\([^;]*\)', re.S), ' '),
8787 (KernRe(r'\s*__packed\s*', re.S), ' '),
8888 (KernRe(r'\s*CRYPTO_MINALIGN_ATTR', re.S), ' '),
89+ (KernRe(r'\s*__private', re.S), ' '),
90+ (KernRe(r'\s*__rcu', re.S), ' '),
8991 (KernRe(r'\s*____cacheline_aligned_in_smp', re.S), ' '),
9092 (KernRe(r'\s*____cacheline_aligned', re.S), ' '),
9193 (KernRe(r'\s*__cacheline_group_(begin|end)\([^\)]+\);'), ''),
@@ -183,6 +185,7 @@ function_xforms = [ · 91 unmodified lines
183185 (KernRe(r"__weak +"), ""),
184186 (KernRe(r"__sched +"), ""),
185187 (KernRe(r"_noprof"), ""),
188+ (KernRe(r"__always_unused *"), ""),
186189 (KernRe(r"__printf\s*\(\s*\d*\s*,\s*\d*\s*\) +"), ""),
187190 (KernRe(r"__(?:re)?alloc_size\s*\(\s*\d+\s*(?:,\s*\d+\s*)?\) +"), ""),
188191 (KernRe(r"__diagnose_as\s*\(\s*\S+\s*(?:,\s*\d+\s*)*\) +"), ""),