History

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

Kees Cook committed 5 years ago

Commit a40a8a11 parent aa872e01 file · +1 −0Browse files

Showing the changes to scripts/kernel-doc (1 of 1 file). Show all

Unified · Split

scripts/kernel-doc+1−0
@@ -1789,6 +1789,7 @@ sub dump_function($$) { · 1788 unmodified lines
1789 $prototype =~ s/__weak +//;1789 $prototype =~ s/__weak +//;
1790 $prototype =~ s/__sched +//;1790 $prototype =~ s/__sched +//;
1791 $prototype =~ s/__printf\s*\(\s*\d*\s*,\s*\d*\s*\) +//;1791 $prototype =~ s/__printf\s*\(\s*\d*\s*,\s*\d*\s*\) +//;
1792 $prototype =~ s/__alloc_size\s*\(\s*\d+\s*(?:,\s*\d+\s*)?\) +//;
1792 my $define = $prototype =~ s/^#\s*define\s+//; #ak added1793 my $define = $prototype =~ s/^#\s*define\s+//; #ak added
1793 $prototype =~ s/__attribute_const__ +//;1794 $prototype =~ s/__attribute_const__ +//;
1794 $prototype =~ s/__attribute__\s*\(\(1795 $prototype =~ s/__attribute__\s*\(\(