Merge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 20 Jan 2016 18:10:23 +0000 (10:10 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 20 Jan 2016 18:10:23 +0000 (10:10 -0800)
Pull misc kbuild updates from Michal Marek:
 - Fix for make O=... perf-tar*
 - make tags revamp and fix for the fallout.  Patch for warnings about
   line breaks inside DEFINE_PER_CPU macros is pending
 - New coccinelle test

* 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  coccinelle: tests: unsigned value cannot be lesser than zero
  tags: Unify emacs and exuberant rules
  tags: Drop the _PE rule
  tags: Do not try to index defconfigs
  tags: Process Kconfig files in a single pass
  tags: Fix erroneous pattern match in a comment
  aic7xxx: Avoid name collision with <linux/list.h>
  tags: Treat header files as C code
  package Makefile: fix perf-tar targets when outdir is set
  scripts/tags.sh: Teach tags about more powerpc macros

1  2 
scripts/tags.sh

diff --cc scripts/tags.sh
index 76f131ebc192228e6928bcc3cedcd47034d7a3b7,bcc1d8cb142b3632d2ab4b4a2cef70b05b88f727..23ba1c6a0a5936f5d3ca1194e92934a05b423644
@@@ -150,8 -145,108 +145,107 @@@ dogtags(
        all_target_sources | gtags -i -f -
  }
  
 -      '/\<__TESTCLEARFLAG_FALSE(\([[:alnum:]_]*\).*/__TestClearPage\1/'
+ # Basic regular expressions with an optional /kind-spec/ for ctags and
+ # the following limitations:
+ # - No regex modifiers
+ # - Use \{0,1\} instead of \?, because etags expects an unescaped ?
+ # - \s is not working with etags, use a space or [ \t]
+ # - \w works, but does not match underscores in etags
+ # - etags regular expressions have to match at the start of a line;
+ #   a ^[^#] is prepended by setup_regex unless an anchor is already present
+ regex_asm=(
+       '/^\(ENTRY\|_GLOBAL\)(\([[:alnum:]_\\]*\)).*/\2/'
+ )
+ regex_c=(
+       '/^SYSCALL_DEFINE[0-9](\([[:alnum:]_]*\).*/sys_\1/'
+       '/^COMPAT_SYSCALL_DEFINE[0-9](\([[:alnum:]_]*\).*/compat_sys_\1/'
+       '/^TRACE_EVENT(\([[:alnum:]_]*\).*/trace_\1/'
+       '/^TRACE_EVENT(\([[:alnum:]_]*\).*/trace_\1_rcuidle/'
+       '/^DEFINE_EVENT([^,)]*, *\([[:alnum:]_]*\).*/trace_\1/'
+       '/^DEFINE_EVENT([^,)]*, *\([[:alnum:]_]*\).*/trace_\1_rcuidle/'
+       '/^PAGEFLAG(\([[:alnum:]_]*\).*/Page\1/'
+       '/^PAGEFLAG(\([[:alnum:]_]*\).*/SetPage\1/'
+       '/^PAGEFLAG(\([[:alnum:]_]*\).*/ClearPage\1/'
+       '/^TESTSETFLAG(\([[:alnum:]_]*\).*/TestSetPage\1/'
+       '/^TESTPAGEFLAG(\([[:alnum:]_]*\).*/Page\1/'
+       '/^SETPAGEFLAG(\([[:alnum:]_]*\).*/SetPage\1/'
+       '/\<__SETPAGEFLAG(\([[:alnum:]_]*\).*/__SetPage\1/'
+       '/\<TESTCLEARFLAG(\([[:alnum:]_]*\).*/TestClearPage\1/'
+       '/\<__TESTCLEARFLAG(\([[:alnum:]_]*\).*/TestClearPage\1/'
+       '/\<CLEARPAGEFLAG(\([[:alnum:]_]*\).*/ClearPage\1/'
+       '/\<__CLEARPAGEFLAG(\([[:alnum:]_]*\).*/__ClearPage\1/'
+       '/^__PAGEFLAG(\([[:alnum:]_]*\).*/__SetPage\1/'
+       '/^__PAGEFLAG(\([[:alnum:]_]*\).*/__ClearPage\1/'
+       '/^PAGEFLAG_FALSE(\([[:alnum:]_]*\).*/Page\1/'
+       '/\<TESTSCFLAG(\([[:alnum:]_]*\).*/TestSetPage\1/'
+       '/\<TESTSCFLAG(\([[:alnum:]_]*\).*/TestClearPage\1/'
+       '/\<SETPAGEFLAG_NOOP(\([[:alnum:]_]*\).*/SetPage\1/'
+       '/\<CLEARPAGEFLAG_NOOP(\([[:alnum:]_]*\).*/ClearPage\1/'
+       '/\<__CLEARPAGEFLAG_NOOP(\([[:alnum:]_]*\).*/__ClearPage\1/'
+       '/\<TESTCLEARFLAG_FALSE(\([[:alnum:]_]*\).*/TestClearPage\1/'
+       '/^TASK_PFA_TEST([^,]*, *\([[:alnum:]_]*\))/task_\1/'
+       '/^TASK_PFA_SET([^,]*, *\([[:alnum:]_]*\))/task_set_\1/'
+       '/^TASK_PFA_CLEAR([^,]*, *\([[:alnum:]_]*\))/task_clear_\1/'
+       '/^DEF_MMIO_\(IN\|OUT\)_[XD](\([[:alnum:]_]*\),[^)]*)/\2/'
+       '/^DEBUGGER_BOILERPLATE(\([[:alnum:]_]*\))/\1/'
+       '/^DEF_PCI_AC_\(\|NO\)RET(\([[:alnum:]_]*\).*/\2/'
+       '/^PCI_OP_READ(\(\w*\).*[1-4])/pci_bus_read_config_\1/'
+       '/^PCI_OP_WRITE(\(\w*\).*[1-4])/pci_bus_write_config_\1/'
+       '/\<DEFINE_\(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/'
+       '/\(^\|\s\)\(\|L\|H\)LIST_HEAD(\([[:alnum:]_]*\)/\3/v/'
+       '/\(^\|\s\)RADIX_TREE(\([[:alnum:]_]*\)/\2/v/'
+       '/\<DEFINE_PER_CPU([^,]*, *\([[:alnum:]_]*\)/\1/v/'
+       '/\<DEFINE_PER_CPU_SHARED_ALIGNED([^,]*, *\([[:alnum:]_]*\)/\1/v/'
+       '/\<DECLARE_WAIT_QUEUE_HEAD(\([[:alnum:]_]*\)/\1/v/'
+       '/\<DECLARE_\(TASKLET\|WORK\|DELAYED_WORK\)(\([[:alnum:]_]*\)/\2/v/'
+       '/\<DEFINE_PCI_DEVICE_TABLE(\([[:alnum:]_]*\)/\1/v/'
+       '/\(^\s\)OFFSET(\([[:alnum:]_]*\)/\2/v/'
+       '/\(^\s\)DEFINE(\([[:alnum:]_]*\)/\2/v/'
+       '/\<DEFINE_HASHTABLE(\([[:alnum:]_]*\)/\1/v/'
+ )
+ regex_kconfig=(
+       '/^[[:blank:]]*\(menu\|\)config[[:blank:]]\+\([[:alnum:]_]\+\)/\2/'
+       '/^[[:blank:]]*\(menu\|\)config[[:blank:]]\+\([[:alnum:]_]\+\)/CONFIG_\2/'
+ )
+ setup_regex()
+ {
+       local mode=$1 lang tmp=() r
+       shift
+       regex=()
+       for lang; do
+               case "$lang" in
+               asm)       tmp=("${regex_asm[@]}") ;;
+               c)         tmp=("${regex_c[@]}") ;;
+               kconfig)   tmp=("${regex_kconfig[@]}") ;;
+               esac
+               for r in "${tmp[@]}"; do
+                       if test "$mode" = "exuberant"; then
+                               regex[${#regex[@]}]="--regex-$lang=${r}b"
+                       else
+                               # Remove ctags /kind-spec/
+                               case "$r" in
+                               /*/*/?/)
+                                       r=${r%?/}
+                               esac
+                               # Prepend ^[^#] unless already anchored
+                               case "$r" in
+                               /^*) ;;
+                               *)
+                                       r="/^[^#]*${r#/}"
+                               esac
+                               regex[${#regex[@]}]="--regex=$r"
+                       fi
+               done
+       done
+ }
  exuberant()
  {
+       setup_regex exuberant asm c
        all_target_sources | xargs $1 -a                        \
        -I __initdata,__exitdata,__initconst,                   \
        -I __initdata_memblock                                  \