From a40a8a1103051610fdee3d121a50ced09bcc1c54 Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Mon, 11 Oct 2021 11:06:50 -0700 Subject: 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 Reported-by: Stephen Rothwell Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20211011180650.3603988-1-keescook@chromium.org Signed-off-by: Jonathan Corbet --- scripts/kernel-doc | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') 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*\(\( -- cgit v1.2.3 From 14efb275d409c774813af4aaac99806927fa215e Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 19 Oct 2021 08:42:50 +0100 Subject: scripts: documentation-file-ref-check: ignore hidden files There's a warning there from a .gitignore file: tools/perf/.gitignore: Documentation/doc.dep This is not really a cross-reference type of warning, so no need to report it. In a matter of fact, it doesn't make sense at all to even parse hidden files, as some text editors may create such files for their own usage. So, just ignore everything that matches this pattern: /\.* Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/dd0125a931b4fecf8fab6be8aa527faa18f78e43.1634629094.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet --- scripts/documentation-file-ref-check | 3 +++ 1 file changed, 3 insertions(+) (limited to 'scripts') diff --git a/scripts/documentation-file-ref-check b/scripts/documentation-file-ref-check index 7187ea5e5149..6865d8e63d5c 100755 --- a/scripts/documentation-file-ref-check +++ b/scripts/documentation-file-ref-check @@ -94,6 +94,9 @@ while () { # Makefiles and scripts contain nasty expressions to parse docs next if ($f =~ m/Makefile/ || $f =~ m/\.sh$/); + # It doesn't make sense to parse hidden files + next if ($f =~ m#/\.#); + # Skip this script next if ($f eq $scriptname); -- cgit v1.2.3 From 6e74e68d0b4cec4255d3af09cfa5426b8e20d549 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 19 Oct 2021 08:42:51 +0100 Subject: scripts: documentation-file-ref-check: fix bpf selftests path tools/testing/selftests/bpf/test_bpftool_synctypes.py use relative patches on the top of BPFTOOL_DIR: BPFTOOL_DIR = os.path.join(LINUX_ROOT, 'tools/bpf/bpftool') Change the script to automatically convert: testing/selftests/bpf -> bpf/bpftool In order to properly check the files used by such script. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/49b765cbac6ccd22d627573154806ec9389d60f0.1634629094.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet --- scripts/documentation-file-ref-check | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/documentation-file-ref-check b/scripts/documentation-file-ref-check index 6865d8e63d5c..68083f2f1122 100755 --- a/scripts/documentation-file-ref-check +++ b/scripts/documentation-file-ref-check @@ -147,6 +147,7 @@ while () { if ($f =~ m/tools/) { my $path = $f; $path =~ s,(.*)/.*,$1,; + $path =~ s,testing/selftests/bpf,bpf/bpftool,; next if (grep -e, glob("$path/$ref $path/../$ref $path/$fulref")); } -- cgit v1.2.3 From 603bdf5d6c092eb05666decd84288dfda71eee90 Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Fri, 29 Oct 2021 19:11:21 -0700 Subject: kernel-doc: support DECLARE_PHY_INTERFACE_MASK() Support the DECLARE_PHY_INTERFACE_MASK() macro that is used to declare a bitmap by converting the macro to DECLARE_BITMAP(), as has been done for the __ETHTOOL_DECLARE_LINK_MODE_MASK() macro. This fixes a 'make htmldocs' warning: include/linux/phylink.h:82: warning: Function parameter or member 'DECLARE_PHY_INTERFACE_MASK(supported_interfaces' not described in 'phylink_config' that was introduced by commit 38c310eb46f5 ("net: phylink: add MAC phy_interface_t bitmap") Signed-off-by: Randy Dunlap Reported-by: Stephen Rothwell Cc: Russell King (Oracle) Link: https://lore.kernel.org/r/45934225-7942-4326-f883-a15378939db9@infradead.org Signed-off-by: Jonathan Corbet --- scripts/kernel-doc | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/kernel-doc b/scripts/kernel-doc index c123bac28f7a..3039059b3d68 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1249,6 +1249,7 @@ sub dump_struct($$) { my $args = qr{([^,)]+)}; # replace DECLARE_BITMAP $members =~ s/__ETHTOOL_DECLARE_LINK_MODE_MASK\s*\(([^\)]+)\)/DECLARE_BITMAP($1, __ETHTOOL_LINK_MODE_MASK_NBITS)/gos; + $members =~ s/DECLARE_PHY_INTERFACE_MASK\s*\(([^\)]+)\)/DECLARE_BITMAP($1, PHY_INTERFACE_MODE_MAX)/gos; $members =~ s/DECLARE_BITMAP\s*\($args,\s*$args\)/unsigned long $1\[BITS_TO_LONGS($2)\]/gos; # replace DECLARE_HASHTABLE $members =~ s/DECLARE_HASHTABLE\s*\($args,\s*$args\)/unsigned long $1\[1 << (($2) - 1)\]/gos; -- cgit v1.2.3