From def35da76073fcf43c2fae4942ebe55b60dc84a6 Mon Sep 17 00:00:00 2001 From: Costa Shulyupin Date: Mon, 9 Dec 2024 10:29:57 +0200 Subject: scripts/tags.sh: Tag timer definitions For timer definitions like DEFINE_TIMER(mytimer, mytimer_handler); ctags generates tags `DEFINE_TIMER` and skips `mytimer` because it doesn't expand the DEFINE_TIMER macro. Configure ctags to generate tag for `mytimer` ans skip the `DEFINE_TIMER` tag in such cases. Signed-off-by: Costa Shulyupin Link: https://lore.kernel.org/r/20241209083004.911013-2-costa.shul@redhat.com Signed-off-by: Greg Kroah-Hartman --- scripts/tags.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/tags.sh b/scripts/tags.sh index b21236377998..7102f14fc775 100755 --- a/scripts/tags.sh +++ b/scripts/tags.sh @@ -188,6 +188,7 @@ regex_c=( '/^PCI_OP_WRITE([[:space:]]*\(\w*\).*[1-4])/pci_bus_write_config_\1/' '/\ Date: Fri, 29 Nov 2024 11:37:45 +0100 Subject: scripts/spdxcheck: Parse j2 comments correctly j2 files use '#}' as comment closure, which trips up the SPDX parser: tools/.../definition.j2: 1:36 Invalid token: #} Handle those comments correctly by removing the closure. Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/878qt2xr46.ffs@tglx Signed-off-by: Greg Kroah-Hartman --- scripts/spdxcheck.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'scripts') diff --git a/scripts/spdxcheck.py b/scripts/spdxcheck.py index 8b8fb115fc81..fe57c9aecf37 100755 --- a/scripts/spdxcheck.py +++ b/scripts/spdxcheck.py @@ -217,6 +217,9 @@ class id_parser(object): # Special case for SH magic boot code files if line.startswith('LIST \"'): expr = expr.rstrip('\"').strip() + # Remove j2 comment closure + if line.startswith('{#'): + expr = expr.rstrip('#}').strip() self.parse(expr) self.spdx_valid += 1 # -- cgit From 154916f4b59dc2228caad5fc98e9e6a7e1a84e19 Mon Sep 17 00:00:00 2001 From: Lukas Bulwahn Date: Wed, 8 Jan 2025 13:52:07 +0100 Subject: scripts/spdxcheck: Handle license identifiers in Jinja comments Commit 4b132aacb076 ("tools: Add xdrgen") adds a tool, which uses Jinja template files, i.e., files with the j2 file extension, for its lightweight code generation. These template files for this tool have proper headers with the SPDX License information, which are included as Jinja comments by enclosing the text with '{#' and '#}'. Sofar, the spdxcheck script does not support to properly parse this license information in Jinja comments and it reports back with 'Invalid token: #}'. Parse Jinja comments properly by stripping the known Jinja comment suffix. Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20250108125207.57486-1-lukas.bulwahn@redhat.com Signed-off-by: Greg Kroah-Hartman --- scripts/spdxcheck.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'scripts') diff --git a/scripts/spdxcheck.py b/scripts/spdxcheck.py index fe57c9aecf37..8d608f61bf37 100755 --- a/scripts/spdxcheck.py +++ b/scripts/spdxcheck.py @@ -214,6 +214,9 @@ class id_parser(object): # Remove trailing xml comment closure if line.strip().endswith('-->'): expr = expr.rstrip('-->').strip() + # Remove trailing Jinja2 comment closure + if line.strip().endswith('#}'): + expr = expr.rstrip('#}').strip() # Special case for SH magic boot code files if line.startswith('LIST \"'): expr = expr.rstrip('\"').strip() -- cgit From 2217573f4c8797eb5ed764a728f986aa80bd403c Mon Sep 17 00:00:00 2001 From: Costa Shulyupin Date: Mon, 13 Jan 2025 10:55:47 +0200 Subject: scripts/tags.sh: Don't tag usages of DECLARE_BITMAP For all bitmap declarations like DECLARE_BITMAP(x, y); ctags generates multiple DECLARE_BITMAP tags for each usage because it doesn't expand the DECLARE_BITMAP macro. Configure ctags to skip generating tags for DECLARE_BITMAP in such cases. The #define DECLARE_BITMAP itself and declared bitmaps are tagged correctly. Signed-off-by: Costa Shulyupin Link: https://lore.kernel.org/r/20250113085554.649141-1-costa.shul@redhat.com Signed-off-by: Greg Kroah-Hartman --- scripts/tags.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/tags.sh b/scripts/tags.sh index 7102f14fc775..dba0bb0213eb 100755 --- a/scripts/tags.sh +++ b/scripts/tags.sh @@ -261,6 +261,7 @@ exuberant() # identifiers to ignore by ctags local ign=( ACPI_EXPORT_SYMBOL + DECLARE_BITMAP DEFINE_{TRACE,MUTEX,TIMER} EXPORT_SYMBOL EXPORT_SYMBOL_GPL EXPORT_TRACEPOINT_SYMBOL EXPORT_TRACEPOINT_SYMBOL_GPL -- cgit