summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2021-10-11 11:06:50 -0700
committerJonathan Corbet <corbet@lwn.net>2021-10-12 14:11:06 -0600
commita40a8a1103051610fdee3d121a50ced09bcc1c54 (patch)
tree25e434d3cd13ba307d8f1869a33db6670f88ed95 /scripts
parentaa872e0647dc0bfd69d83c3342bfac3fb4bbbb4f (diff)
downloadlwn-a40a8a1103051610fdee3d121a50ced09bcc1c54.tar.gz
lwn-a40a8a1103051610fdee3d121a50ced09bcc1c54.zip
scripts: kernel-doc: Ignore __alloc_size() attribute
Fixes "Compiler Attributes: add __alloc_size() for better bounds checking" so that the __alloc_size() macro is ignored for function prototypes when generating kerndoc. Avoids warnings like: ./include/linux/slab.h:662: warning: Function parameter or member '1' not described in '__alloc_size' ./include/linux/slab.h:662: warning: Function parameter or member '2' not described in '__alloc_size' ./include/linux/slab.h:662: warning: expecting prototype for kcalloc(). Prototype was for __alloc_size() instead Suggested-by: Matthew Wilcox <willy@infradead.org> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/r/20211011180650.3603988-1-keescook@chromium.org Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/kernel-doc1
1 files changed, 1 insertions, 0 deletions
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index cfcb60737957..c123bac28f7a 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1789,6 +1789,7 @@ sub dump_function($$) {
$prototype =~ s/__weak +//;
$prototype =~ s/__sched +//;
$prototype =~ s/__printf\s*\(\s*\d*\s*,\s*\d*\s*\) +//;
+ $prototype =~ s/__alloc_size\s*\(\s*\d+\s*(?:,\s*\d+\s*)?\) +//;
my $define = $prototype =~ s/^#\s*define\s+//; #ak added
$prototype =~ s/__attribute_const__ +//;
$prototype =~ s/__attribute__\s*\(\(