Skip to contentSkip to conversation

tags: add a space regex to DECLARE_BITMAP

PATCH In review Zhaoyu Liu 2 participants 3 messages Nov 1, 2021 – Nov 2, 2021 1 message not in the archive

lore
Share & tools
lore

Zhaoyu Liu

author
#0 lore raw

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
index b24bfaec6290..7e5f19391f20 100755
@@ -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
#1 lore raw
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.

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
---
 scripts/tags.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/tags.sh +1 -1
index b24bfaec6290..7e5f19391f20 100755
@@ -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...

A message that is not in the archive (sent off-list or not yet received): CAOk_PdPzKukZZiQJ2HYN_j3Zw_t7UXUqqcjDb4OBB39o-LbvNA@mail.gmail.com

#3 lore raw
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.

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
---
 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
index b24bfaec6290..7e5f19391f20 100755
@@ -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.