scripts/tags.sh: use list of identifiers to ignore
authorCosta Shulyupin <costa.shul@redhat.com>
Fri, 25 Oct 2024 06:45:30 +0000 (09:45 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 5 Nov 2024 04:33:47 +0000 (05:33 +0100)
Literal string of ctags arguments is too long and overloaded.

Replace it with neat bash list.

Identifiers are sorted, and those with a new first
letter start on a new line for better maintainability.

Signed-off-by: Costa Shulyupin <costa.shul@redhat.com>
Link: https://lore.kernel.org/r/20241025064536.3022849-1-costa.shul@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
scripts/tags.sh

index 4a9b75f..933e923 100755 (executable)
@@ -259,19 +259,29 @@ exuberant()
            CTAGS_EXTRA="extras"
        fi
        setup_regex exuberant asm c
-       all_target_sources | xargs $1 -a                        \
-       -I __initdata,__exitdata,__initconst,__ro_after_init    \
-       -I __initdata_memblock                                  \
-       -I __refdata,__attribute,__maybe_unused,__always_unused \
-       -I __acquires,__releases,__deprecated,__always_inline   \
-       -I __read_mostly,__aligned,____cacheline_aligned        \
-       -I ____cacheline_aligned_in_smp                         \
-       -I __cacheline_aligned,__cacheline_aligned_in_smp       \
-       -I ____cacheline_internodealigned_in_smp                \
-       -I __used,__packed,__packed2__,__must_check,__must_hold \
-       -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL,ACPI_EXPORT_SYMBOL   \
-       -I DEFINE_TRACE,EXPORT_TRACEPOINT_SYMBOL,EXPORT_TRACEPOINT_SYMBOL_GPL \
-       -I static,const                                         \
+       # identifiers to ignore by ctags
+       local ign=(
+               ACPI_EXPORT_SYMBOL
+               DEFINE_TRACE
+               EXPORT_SYMBOL EXPORT_SYMBOL_GPL
+               EXPORT_TRACEPOINT_SYMBOL EXPORT_TRACEPOINT_SYMBOL_GPL
+               ____cacheline_aligned ____cacheline_aligned_in_smp
+               ____cacheline_internodealigned_in_smp
+               __acquires __aligned __always_inline __always_unused
+               __attribute
+               __cacheline_aligned __cacheline_aligned_in_smp
+               __deprecated
+               __exitdata
+               __initconst __initdata __initdata_memblock
+               __maybe_unused __must_check __must_hold
+               __packed __packed2__
+               __read_mostly __refdata __releases __ro_after_init
+               __used
+               const
+               static
+       )
+       all_target_sources | \
+       xargs $1 -a -I "$(IFS=','; echo "${ign[*]}")" \
        --$CTAGS_EXTRA=+fq --c-kinds=+px --fields=+iaS --langmap=c:+.h \
        "${regex[@]}"