tags: add a space regex to DECLARE_BITMAP
PATCH 1/1 tags: add a space regex to DECLARE_BITMAP
When "make tags", it prompts a warning:
ctags: Warning: drivers/pci/controller/pcie-apple.c:150:
null expansion of name pattern "\1"
The reason is that there is an indentation beside arguments of DECLARE_BITMAP, but it can parsed normally by gtags. It's also allowed in C.
So fix this regex temporarily, and wait for better solutions applied to other regexs.
--- scripts/tags.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/tags.sh +1 -1
@@ -186,7 +186,7 @@ regex_c=( '/\<DEFINE_\(RT_MUTEX\|MUTEX\|SEMAPHORE\|SPINLOCK\)(\([[:alnum:]_]*\)/\2/v/' '/\<DEFINE_\(RAW_SPINLOCK\|RWLOCK\|SEQLOCK\)(\([[:alnum:]_]*\)/\2/v/' '/\<DECLARE_\(RWSEM\|COMPLETION\)(\([[:alnum:]_]\+\)/\2/v/' - '/\<DECLARE_BITMAP(\([[:alnum:]_]*\)/\1/v/' + '/\<DECLARE_BITMAP([[:space:]]*\([[:alnum:]_]*\)/\1/v/' '/\(^\|\s\)\(\|L\|H\)LIST_HEAD(\([[:alnum:]_]*\)/\3/v/' '/\(^\|\s\)RADIX_TREE(\([[:alnum:]_]*\)/\2/v/' '/\<DEFINE_PER_CPU([^,]*, *\([[:alnum:]_]*\)/\1/v/'
Signature · 1 line
2.17.1
Quoted 5 lines · Zhaoyu Liu
When "make tags", it prompts a warning:
ctags: Warning:
drivers/pci/controller/pcie-apple.c:150:
null expansion of name pattern "\1"
Quoted 8 lines
The reason is that there is an indentation beside arguments of
DECLARE_BITMAP, but it can parsed normally by gtags. It's also allowed in C.So fix this regex temporarily, and wait for better solutions applied to other regexs.
Reviewed-by Marc Zyngier <[email protected]>
No, please! I never reviewed this patch. I *suggested*i it [1] as a potential avenue for improvement.
You cannot put this tag on a patch unless someone explicitly grants it.
Quoted 18 lines
Signed-off-by Zhaoyu Liu <[email protected]>--- scripts/tags.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)scripts/tags.sh +1
-1@@ -186,7 +186,7 @@ regex_c=( '/\<DEFINE_\(RT_MUTEX\|MUTEX\|SEMAPHORE\|SPINLOCK\)(\([[:alnum:]_]*\)/\2/v/' '/\<DEFINE_\(RAW_SPINLOCK\|RWLOCK\|SEQLOCK\)(\([[:alnum:]_]*\)/\2/v/' '/\<DECLARE_\(RWSEM\|COMPLETION\)(\([[:alnum:]_]\+\)/\2/v/' - '/\<DECLARE_BITMAP(\([[:alnum:]_]*\)/\1/v/' + '/\<DECLARE_BITMAP([[:space:]]*\([[:alnum:]_]*\)/\1/v/' '/\(^\|\s\)\(\|L\|H\)LIST_HEAD(\([[:alnum:]_]*\)/\3/v/' '/\(^\|\s\)RADIX_TREE(\([[:alnum:]_]*\)/\2/v/'
Quoted 1 line
'/\<DEFINE_PER_CPU([^,]*, *\([[:alnum:]_]*\)/\1/v/'
More importantly, and assuming this is the correct approach, why should we limit this to DECLARE_BITMAP()?
Thanks,
M.
[1] https://lore.kernel.org/r/[email protected]
Signature · 1 line
Jazz is not dead. It just smells funny...
Quoted 23 lines · Zackary Liu
Hi Marc,
Quoted 19 lines · Marc Zyngier
Quoted 5 lines · Zhaoyu Liu
When "make tags", it prompts a warning:
ctags: Warning:
drivers/pci/controller/pcie-apple.c:150:
null expansion of name pattern "\1"Quoted 8 lines
The reason is that there is an indentation beside arguments of
DECLARE_BITMAP, but it can parsed normally by gtags. It's also allowed in C.So fix this regex temporarily, and wait for better solutions applied to other regexs.
Reviewed-by Marc Zyngier <[email protected]>No, please! I never reviewed this patch. I *suggested*i it [1] as a potential avenue for improvement.
Quoted 6 lines
Quoted 3 lines
You cannot put this tag on a patch unless someone explicitly grants it.
I'm really sorry that I used the wrong "Reviewed-by" tag, Perhaps "Suggested-by" tag would be more appropriate.
Yes, that'd be the right one.
Quoted 25 lines
Sorry again.
Quoted 5 lines
Quoted 5 lines
Signed-off-by Zhaoyu Liu <[email protected]>--- scripts/tags.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Quoted 7 lines
scripts/tags.sh regex_c=( · line 187
Quoted 7 lines
scripts/tags.sh +0
-0@@ -186,7 +186,7 @@ regex_c=('/\<DEFINE_\(RT_MUTEX\|MUTEX\|SEMAPHORE\|SPINLOCK\)(\([[:alnum:]_]*\)/\2/v/'
Quoted 1 line
Quoted 1 line
'/\<DEFINE_\(RAW_SPINLOCK\|RWLOCK\|SEQLOCK\)(\([[:alnum:]_]*\)/\2/v/'
Quoted 7 lines
Quoted 6 lines
'/\<DECLARE_\(RWSEM\|COMPLETION\)(\([[:alnum:]_]\+\)/\2/v/'scripts/tags.sh +1
-1- '/\<DECLARE_BITMAP(\([[:alnum:]_]*\)/\1/v/' + '/\<DECLARE_BITMAP([[:space:]]*\([[:alnum:]_]*\)/\1/v/' '/\(^\|\s\)\(\|L\|H\)LIST_HEAD(\([[:alnum:]_]*\)/\3/v/' '/\(^\|\s\)RADIX_TREE(\([[:alnum:]_]*\)/\2/v/' '/\<DEFINE_PER_CPU([^,]*, *\([[:alnum:]_]*\)/\1/v/'
Quoted 5 lines
Quoted 2 lines
More importantly, and assuming this is the correct approach, why should we limit this to
DECLARE_BITMAP()?I will try to come up with a better approach, and commit [ patch v2 ] later.
You could try and apply the same approach consistently for all macros. Since you are using ctags, you're in a good position to test it and work out whether this is a sensible approach.
Thanks,
M.
Signature · 1 line
Without deviation from the norm, progress is not possible.