Skip to content

Commit a40a8a1

Browse files
keesJonathan Corbet
authored andcommitted
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>
1 parent aa872e0 commit a40a8a1

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎scripts/kernel-doc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1789,6 +1789,7 @@ sub dump_function($$) {
17891789
$prototype =~ s/__weak +//;
17901790
$prototype =~ s/__sched +//;
17911791
$prototype =~ s/__printf\s*\(\s*\d*\s*,\s*\d*\s*\) +//;
1792+
$prototype =~ s/__alloc_size\s*\(\s*\d+\s*(?:,\s*\d+\s*)?\) +//;
17921793
my $define = $prototype =~ s/^#\s*define\s+//; #ak added
17931794
$prototype =~ s/__attribute_const__ +//;
17941795
$prototype =~ s/__attribute__\s*\(\(

0 commit comments

Comments
 (0)