aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-01-20 13:10:23 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-01-20 13:10:23 -0500
commit90bf353bc1451b71067b12541db08ab7774723eb (patch)
treeb52fe62bc52f18964f12686649c9cb89a453c430
parentaf75d517a8b83cea88d8039beca1213813eb35f0 (diff)
parent3f984cb39907f87515d83657ecd471ae396a6c4a (diff)
Merge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
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
-rw-r--r--drivers/scsi/aic7xxx/aic79xx.h4
-rw-r--r--drivers/scsi/aic7xxx/aic79xx_osm.h5
-rw-r--r--drivers/scsi/aic7xxx/aic7xxx.h2
-rw-r--r--drivers/scsi/aic7xxx/aic7xxx_osm.h5
-rw-r--r--drivers/scsi/aic7xxx/queue.h2
-rw-r--r--scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci75
-rw-r--r--scripts/package/Makefile4
-rwxr-xr-xscripts/tags.sh215
8 files changed, 188 insertions, 124 deletions
diff --git a/drivers/scsi/aic7xxx/aic79xx.h b/drivers/scsi/aic7xxx/aic79xx.h
index df2e0e5367d2..d47b527b25dd 100644
--- a/drivers/scsi/aic7xxx/aic79xx.h
+++ b/drivers/scsi/aic7xxx/aic79xx.h
@@ -624,7 +624,7 @@ struct scb {
624}; 624};
625 625
626TAILQ_HEAD(scb_tailq, scb); 626TAILQ_HEAD(scb_tailq, scb);
627LIST_HEAD(scb_list, scb); 627BSD_LIST_HEAD(scb_list, scb);
628 628
629struct scb_data { 629struct scb_data {
630 /* 630 /*
@@ -1069,7 +1069,7 @@ struct ahd_softc {
1069 /* 1069 /*
1070 * SCBs that have been sent to the controller 1070 * SCBs that have been sent to the controller
1071 */ 1071 */
1072 LIST_HEAD(, scb) pending_scbs; 1072 BSD_LIST_HEAD(, scb) pending_scbs;
1073 1073
1074 /* 1074 /*
1075 * Current register window mode information. 1075 * Current register window mode information.
diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.h b/drivers/scsi/aic7xxx/aic79xx_osm.h
index c58fa33c6592..728193a42e6e 100644
--- a/drivers/scsi/aic7xxx/aic79xx_osm.h
+++ b/drivers/scsi/aic7xxx/aic79xx_osm.h
@@ -65,11 +65,6 @@
65/* Core SCSI definitions */ 65/* Core SCSI definitions */
66#define AIC_LIB_PREFIX ahd 66#define AIC_LIB_PREFIX ahd
67 67
68/* Name space conflict with BSD queue macros */
69#ifdef LIST_HEAD
70#undef LIST_HEAD
71#endif
72
73#include "cam.h" 68#include "cam.h"
74#include "queue.h" 69#include "queue.h"
75#include "scsi_message.h" 70#include "scsi_message.h"
diff --git a/drivers/scsi/aic7xxx/aic7xxx.h b/drivers/scsi/aic7xxx/aic7xxx.h
index f695774645c1..4ce4e903a759 100644
--- a/drivers/scsi/aic7xxx/aic7xxx.h
+++ b/drivers/scsi/aic7xxx/aic7xxx.h
@@ -916,7 +916,7 @@ struct ahc_softc {
916 /* 916 /*
917 * SCBs that have been sent to the controller 917 * SCBs that have been sent to the controller
918 */ 918 */
919 LIST_HEAD(, scb) pending_scbs; 919 BSD_LIST_HEAD(, scb) pending_scbs;
920 920
921 /* 921 /*
922 * Counting lock for deferring the release of additional 922 * Counting lock for deferring the release of additional
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.h b/drivers/scsi/aic7xxx/aic7xxx_osm.h
index bc4cca92ff04..54c702864103 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.h
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.h
@@ -82,11 +82,6 @@
82/* Core SCSI definitions */ 82/* Core SCSI definitions */
83#define AIC_LIB_PREFIX ahc 83#define AIC_LIB_PREFIX ahc
84 84
85/* Name space conflict with BSD queue macros */
86#ifdef LIST_HEAD
87#undef LIST_HEAD
88#endif
89
90#include "cam.h" 85#include "cam.h"
91#include "queue.h" 86#include "queue.h"
92#include "scsi_message.h" 87#include "scsi_message.h"
diff --git a/drivers/scsi/aic7xxx/queue.h b/drivers/scsi/aic7xxx/queue.h
index 8adf8003a164..ba602981f193 100644
--- a/drivers/scsi/aic7xxx/queue.h
+++ b/drivers/scsi/aic7xxx/queue.h
@@ -246,7 +246,7 @@ struct { \
246/* 246/*
247 * List declarations. 247 * List declarations.
248 */ 248 */
249#define LIST_HEAD(name, type) \ 249#define BSD_LIST_HEAD(name, type) \
250struct name { \ 250struct name { \
251 struct type *lh_first; /* first element */ \ 251 struct type *lh_first; /* first element */ \
252} 252}
diff --git a/scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci b/scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci
new file mode 100644
index 000000000000..8fa5a3c7b784
--- /dev/null
+++ b/scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci
@@ -0,0 +1,75 @@
1/// Unsigned expressions cannot be lesser than zero. Presence of
2/// comparisons 'unsigned (<|<=|>|>=) 0' often indicates a bug,
3/// usually wrong type of variable.
4///
5/// To reduce number of false positives following tests have been added:
6/// - parts of range checks are skipped, eg. "if (u < 0 || u > 15) ...",
7/// developers prefer to keep such code,
8/// - comparisons "<= 0" and "> 0" are performed only on results of
9/// signed functions/macros,
10/// - hardcoded list of signed functions/macros with always non-negative
11/// result is used to avoid false positives difficult to detect by other ways
12///
13// Confidence: Average
14// Copyright: (C) 2015 Andrzej Hajda, Samsung Electronics Co., Ltd. GPLv2.
15// URL: http://coccinelle.lip6.fr/
16// Options: --all-includes
17
18virtual context
19virtual org
20virtual report
21
22@r_cmp@
23position p;
24typedef bool, u8, u16, u32, u64;
25{unsigned char, unsigned short, unsigned int, unsigned long, unsigned long long,
26 size_t, bool, u8, u16, u32, u64} v;
27expression e;
28@@
29
30 \( v = e \| &v \)
31 ...
32 (\( v@p < 0 \| v@p <= 0 \| v@p >= 0 \| v@p > 0 \))
33
34@r@
35position r_cmp.p;
36typedef s8, s16, s32, s64;
37{char, short, int, long, long long, ssize_t, s8, s16, s32, s64} vs;
38expression c, e, v;
39identifier f !~ "^(ata_id_queue_depth|btrfs_copy_from_user|dma_map_sg|dma_map_sg_attrs|fls|fls64|gameport_time|get_write_extents|nla_len|ntoh24|of_flat_dt_match|of_get_child_count|uart_circ_chars_pending|[A-Z0-9_]+)$";
40@@
41
42(
43 v = f(...)@vs;
44 ... when != v = e;
45* (\( v@p <=@e 0 \| v@p >@e 0 \))
46 ... when any
47|
48(
49 (\( v@p < 0 \| v@p <= 0 \)) || ... || (\( v >= c \| v > c \))
50|
51 (\( v >= c \| v > c \)) || ... || (\( v@p < 0 \| v@p <= 0 \))
52|
53 (\( v@p >= 0 \| v@p > 0 \)) && ... && (\( v < c \| v <= c \))
54|
55 ((\( v < c \| v <= c \) && ... && \( v@p >= 0 \| v@p > 0 \)))
56|
57* (\( v@p <@e 0 \| v@p >=@e 0 \))
58)
59)
60
61@script:python depends on org@
62p << r_cmp.p;
63e << r.e;
64@@
65
66msg = "WARNING: Unsigned expression compared with zero: %s" % (e)
67coccilib.org.print_todo(p[0], msg)
68
69@script:python depends on report@
70p << r_cmp.p;
71e << r.e;
72@@
73
74msg = "WARNING: Unsigned expression compared with zero: %s" % (e)
75coccilib.report.print_report(p[0], msg)
diff --git a/scripts/package/Makefile b/scripts/package/Makefile
index 1aca224e8597..c2c7389bfbab 100644
--- a/scripts/package/Makefile
+++ b/scripts/package/Makefile
@@ -118,12 +118,12 @@ quiet_cmd_perf_tar = TAR
118 cmd_perf_tar = \ 118 cmd_perf_tar = \
119git --git-dir=$(srctree)/.git archive --prefix=$(perf-tar)/ \ 119git --git-dir=$(srctree)/.git archive --prefix=$(perf-tar)/ \
120 HEAD^{tree} $$(cd $(srctree); \ 120 HEAD^{tree} $$(cd $(srctree); \
121 echo $$(cat $(srctree)/tools/perf/MANIFEST)) \ 121 echo $$(cat tools/perf/MANIFEST)) \
122 -o $(perf-tar).tar; \ 122 -o $(perf-tar).tar; \
123mkdir -p $(perf-tar); \ 123mkdir -p $(perf-tar); \
124git --git-dir=$(srctree)/.git rev-parse HEAD > $(perf-tar)/HEAD; \ 124git --git-dir=$(srctree)/.git rev-parse HEAD > $(perf-tar)/HEAD; \
125(cd $(srctree)/tools/perf; \ 125(cd $(srctree)/tools/perf; \
126util/PERF-VERSION-GEN ../../$(perf-tar)/ 2>/dev/null); \ 126util/PERF-VERSION-GEN $(CURDIR)/$(perf-tar)/); \
127tar rf $(perf-tar).tar $(perf-tar)/HEAD $(perf-tar)/PERF-VERSION-FILE; \ 127tar rf $(perf-tar).tar $(perf-tar)/HEAD $(perf-tar)/PERF-VERSION-FILE; \
128rm -r $(perf-tar); \ 128rm -r $(perf-tar); \
129$(if $(findstring tar-src,$@),, \ 129$(if $(findstring tar-src,$@),, \
diff --git a/scripts/tags.sh b/scripts/tags.sh
index 76f131ebc192..23ba1c6a0a59 100755
--- a/scripts/tags.sh
+++ b/scripts/tags.sh
@@ -1,4 +1,4 @@
1#!/bin/sh 1#!/bin/bash
2# Generate tags or cscope files 2# Generate tags or cscope files
3# Usage tags.sh <mode> 3# Usage tags.sh <mode>
4# 4#
@@ -134,11 +134,6 @@ all_kconfigs()
134 find_other_sources 'Kconfig*' 134 find_other_sources 'Kconfig*'
135} 135}
136 136
137all_defconfigs()
138{
139 find_sources $ALLSOURCE_ARCHS "defconfig"
140}
141
142docscope() 137docscope()
143{ 138{
144 (echo \-k; echo \-q; all_target_sources) > cscope.files 139 (echo \-k; echo \-q; all_target_sources) > cscope.files
@@ -150,8 +145,107 @@ dogtags()
150 all_target_sources | gtags -i -f - 145 all_target_sources | gtags -i -f -
151} 146}
152 147
148# Basic regular expressions with an optional /kind-spec/ for ctags and
149# the following limitations:
150# - No regex modifiers
151# - Use \{0,1\} instead of \?, because etags expects an unescaped ?
152# - \s is not working with etags, use a space or [ \t]
153# - \w works, but does not match underscores in etags
154# - etags regular expressions have to match at the start of a line;
155# a ^[^#] is prepended by setup_regex unless an anchor is already present
156regex_asm=(
157 '/^\(ENTRY\|_GLOBAL\)(\([[:alnum:]_\\]*\)).*/\2/'
158)
159regex_c=(
160 '/^SYSCALL_DEFINE[0-9](\([[:alnum:]_]*\).*/sys_\1/'
161 '/^COMPAT_SYSCALL_DEFINE[0-9](\([[:alnum:]_]*\).*/compat_sys_\1/'
162 '/^TRACE_EVENT(\([[:alnum:]_]*\).*/trace_\1/'
163 '/^TRACE_EVENT(\([[:alnum:]_]*\).*/trace_\1_rcuidle/'
164 '/^DEFINE_EVENT([^,)]*, *\([[:alnum:]_]*\).*/trace_\1/'
165 '/^DEFINE_EVENT([^,)]*, *\([[:alnum:]_]*\).*/trace_\1_rcuidle/'
166 '/^PAGEFLAG(\([[:alnum:]_]*\).*/Page\1/'
167 '/^PAGEFLAG(\([[:alnum:]_]*\).*/SetPage\1/'
168 '/^PAGEFLAG(\([[:alnum:]_]*\).*/ClearPage\1/'
169 '/^TESTSETFLAG(\([[:alnum:]_]*\).*/TestSetPage\1/'
170 '/^TESTPAGEFLAG(\([[:alnum:]_]*\).*/Page\1/'
171 '/^SETPAGEFLAG(\([[:alnum:]_]*\).*/SetPage\1/'
172 '/\<__SETPAGEFLAG(\([[:alnum:]_]*\).*/__SetPage\1/'
173 '/\<TESTCLEARFLAG(\([[:alnum:]_]*\).*/TestClearPage\1/'
174 '/\<__TESTCLEARFLAG(\([[:alnum:]_]*\).*/TestClearPage\1/'
175 '/\<CLEARPAGEFLAG(\([[:alnum:]_]*\).*/ClearPage\1/'
176 '/\<__CLEARPAGEFLAG(\([[:alnum:]_]*\).*/__ClearPage\1/'
177 '/^__PAGEFLAG(\([[:alnum:]_]*\).*/__SetPage\1/'
178 '/^__PAGEFLAG(\([[:alnum:]_]*\).*/__ClearPage\1/'
179 '/^PAGEFLAG_FALSE(\([[:alnum:]_]*\).*/Page\1/'
180 '/\<TESTSCFLAG(\([[:alnum:]_]*\).*/TestSetPage\1/'
181 '/\<TESTSCFLAG(\([[:alnum:]_]*\).*/TestClearPage\1/'
182 '/\<SETPAGEFLAG_NOOP(\([[:alnum:]_]*\).*/SetPage\1/'
183 '/\<CLEARPAGEFLAG_NOOP(\([[:alnum:]_]*\).*/ClearPage\1/'
184 '/\<__CLEARPAGEFLAG_NOOP(\([[:alnum:]_]*\).*/__ClearPage\1/'
185 '/\<TESTCLEARFLAG_FALSE(\([[:alnum:]_]*\).*/TestClearPage\1/'
186 '/^TASK_PFA_TEST([^,]*, *\([[:alnum:]_]*\))/task_\1/'
187 '/^TASK_PFA_SET([^,]*, *\([[:alnum:]_]*\))/task_set_\1/'
188 '/^TASK_PFA_CLEAR([^,]*, *\([[:alnum:]_]*\))/task_clear_\1/'
189 '/^DEF_MMIO_\(IN\|OUT\)_[XD](\([[:alnum:]_]*\),[^)]*)/\2/'
190 '/^DEBUGGER_BOILERPLATE(\([[:alnum:]_]*\))/\1/'
191 '/^DEF_PCI_AC_\(\|NO\)RET(\([[:alnum:]_]*\).*/\2/'
192 '/^PCI_OP_READ(\(\w*\).*[1-4])/pci_bus_read_config_\1/'
193 '/^PCI_OP_WRITE(\(\w*\).*[1-4])/pci_bus_write_config_\1/'
194 '/\<DEFINE_\(MUTEX\|SEMAPHORE\|SPINLOCK\)(\([[:alnum:]_]*\)/\2/v/'
195 '/\<DEFINE_\(RAW_SPINLOCK\|RWLOCK\|SEQLOCK\)(\([[:alnum:]_]*\)/\2/v/'
196 '/\<DECLARE_\(RWSEM\|COMPLETION\)(\([[:alnum:]_]\+\)/\2/v/'
197 '/\<DECLARE_BITMAP(\([[:alnum:]_]*\)/\1/v/'
198 '/\(^\|\s\)\(\|L\|H\)LIST_HEAD(\([[:alnum:]_]*\)/\3/v/'
199 '/\(^\|\s\)RADIX_TREE(\([[:alnum:]_]*\)/\2/v/'
200 '/\<DEFINE_PER_CPU([^,]*, *\([[:alnum:]_]*\)/\1/v/'
201 '/\<DEFINE_PER_CPU_SHARED_ALIGNED([^,]*, *\([[:alnum:]_]*\)/\1/v/'
202 '/\<DECLARE_WAIT_QUEUE_HEAD(\([[:alnum:]_]*\)/\1/v/'
203 '/\<DECLARE_\(TASKLET\|WORK\|DELAYED_WORK\)(\([[:alnum:]_]*\)/\2/v/'
204 '/\<DEFINE_PCI_DEVICE_TABLE(\([[:alnum:]_]*\)/\1/v/'
205 '/\(^\s\)OFFSET(\([[:alnum:]_]*\)/\2/v/'
206 '/\(^\s\)DEFINE(\([[:alnum:]_]*\)/\2/v/'
207 '/\<DEFINE_HASHTABLE(\([[:alnum:]_]*\)/\1/v/'
208)
209regex_kconfig=(
210 '/^[[:blank:]]*\(menu\|\)config[[:blank:]]\+\([[:alnum:]_]\+\)/\2/'
211 '/^[[:blank:]]*\(menu\|\)config[[:blank:]]\+\([[:alnum:]_]\+\)/CONFIG_\2/'
212)
213setup_regex()
214{
215 local mode=$1 lang tmp=() r
216 shift
217
218 regex=()
219 for lang; do
220 case "$lang" in
221 asm) tmp=("${regex_asm[@]}") ;;
222 c) tmp=("${regex_c[@]}") ;;
223 kconfig) tmp=("${regex_kconfig[@]}") ;;
224 esac
225 for r in "${tmp[@]}"; do
226 if test "$mode" = "exuberant"; then
227 regex[${#regex[@]}]="--regex-$lang=${r}b"
228 else
229 # Remove ctags /kind-spec/
230 case "$r" in
231 /*/*/?/)
232 r=${r%?/}
233 esac
234 # Prepend ^[^#] unless already anchored
235 case "$r" in
236 /^*) ;;
237 *)
238 r="/^[^#]*${r#/}"
239 esac
240 regex[${#regex[@]}]="--regex=$r"
241 fi
242 done
243 done
244}
245
153exuberant() 246exuberant()
154{ 247{
248 setup_regex exuberant asm c
155 all_target_sources | xargs $1 -a \ 249 all_target_sources | xargs $1 -a \
156 -I __initdata,__exitdata,__initconst, \ 250 -I __initdata,__exitdata,__initconst, \
157 -I __initdata_memblock \ 251 -I __initdata_memblock \
@@ -165,116 +259,21 @@ exuberant()
165 -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL,ACPI_EXPORT_SYMBOL \ 259 -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL,ACPI_EXPORT_SYMBOL \
166 -I DEFINE_TRACE,EXPORT_TRACEPOINT_SYMBOL,EXPORT_TRACEPOINT_SYMBOL_GPL \ 260 -I DEFINE_TRACE,EXPORT_TRACEPOINT_SYMBOL,EXPORT_TRACEPOINT_SYMBOL_GPL \
167 -I static,const \ 261 -I static,const \
168 --extra=+f --c-kinds=+px \ 262 --extra=+f --c-kinds=+px --langmap=c:+.h "${regex[@]}"
169 --regex-asm='/^(ENTRY|_GLOBAL)\(([^)]*)\).*/\2/' \
170 --regex-c='/^SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/sys_\1/' \
171 --regex-c='/^COMPAT_SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/compat_sys_\1/' \
172 --regex-c++='/^TRACE_EVENT\(([^,)]*).*/trace_\1/' \
173 --regex-c++='/^TRACE_EVENT\(([^,)]*).*/trace_\1_rcuidle/' \
174 --regex-c++='/^DEFINE_EVENT\([^,)]*, *([^,)]*).*/trace_\1/' \
175 --regex-c++='/^DEFINE_EVENT\([^,)]*, *([^,)]*).*/trace_\1_rcuidle/' \
176 --regex-c++='/PAGEFLAG\(([^,)]*).*/Page\1/' \
177 --regex-c++='/PAGEFLAG\(([^,)]*).*/SetPage\1/' \
178 --regex-c++='/PAGEFLAG\(([^,)]*).*/ClearPage\1/' \
179 --regex-c++='/TESTSETFLAG\(([^,)]*).*/TestSetPage\1/' \
180 --regex-c++='/TESTPAGEFLAG\(([^,)]*).*/Page\1/' \
181 --regex-c++='/SETPAGEFLAG\(([^,)]*).*/SetPage\1/' \
182 --regex-c++='/__SETPAGEFLAG\(([^,)]*).*/__SetPage\1/' \
183 --regex-c++='/TESTCLEARFLAG\(([^,)]*).*/TestClearPage\1/' \
184 --regex-c++='/__TESTCLEARFLAG\(([^,)]*).*/TestClearPage\1/' \
185 --regex-c++='/CLEARPAGEFLAG\(([^,)]*).*/ClearPage\1/' \
186 --regex-c++='/__CLEARPAGEFLAG\(([^,)]*).*/__ClearPage\1/' \
187 --regex-c++='/__PAGEFLAG\(([^,)]*).*/__SetPage\1/' \
188 --regex-c++='/__PAGEFLAG\(([^,)]*).*/__ClearPage\1/' \
189 --regex-c++='/PAGEFLAG_FALSE\(([^,)]*).*/Page\1/' \
190 --regex-c++='/TESTSCFLAG\(([^,)]*).*/TestSetPage\1/' \
191 --regex-c++='/TESTSCFLAG\(([^,)]*).*/TestClearPage\1/' \
192 --regex-c++='/SETPAGEFLAG_NOOP\(([^,)]*).*/SetPage\1/' \
193 --regex-c++='/CLEARPAGEFLAG_NOOP\(([^,)]*).*/ClearPage\1/' \
194 --regex-c++='/__CLEARPAGEFLAG_NOOP\(([^,)]*).*/__ClearPage\1/' \
195 --regex-c++='/TESTCLEARFLAG_FALSE\(([^,)]*).*/TestClearPage\1/' \
196 --regex-c++='/_PE\(([^,)]*).*/PEVENT_ERRNO__\1/' \
197 --regex-c++='/TASK_PFA_TEST\([^,]*,\s*([^)]*)\)/task_\1/' \
198 --regex-c++='/TASK_PFA_SET\([^,]*,\s*([^)]*)\)/task_set_\1/' \
199 --regex-c++='/TASK_PFA_CLEAR\([^,]*,\s*([^)]*)\)/task_clear_\1/'\
200 --regex-c++='/DEF_MMIO_(IN|OUT)_(X|D)\(([^,]*),\s*[^)]*\)/\3/' \
201 --regex-c++='/DEBUGGER_BOILERPLATE\(([^,]*)\)/\1/' \
202 --regex-c='/PCI_OP_READ\((\w*).*[1-4]\)/pci_bus_read_config_\1/' \
203 --regex-c='/PCI_OP_WRITE\((\w*).*[1-4]\)/pci_bus_write_config_\1/' \
204 --regex-c='/DEFINE_(MUTEX|SEMAPHORE|SPINLOCK)\((\w*)/\2/v/' \
205 --regex-c='/DEFINE_(RAW_SPINLOCK|RWLOCK|SEQLOCK)\((\w*)/\2/v/' \
206 --regex-c='/DECLARE_(RWSEM|COMPLETION)\((\w*)/\2/v/' \
207 --regex-c='/DECLARE_BITMAP\((\w*)/\1/v/' \
208 --regex-c='/(^|\s)(|L|H)LIST_HEAD\((\w*)/\3/v/' \
209 --regex-c='/(^|\s)RADIX_TREE\((\w*)/\2/v/' \
210 --regex-c='/DEFINE_PER_CPU\(([^,]*,\s*)(\w*).*\)/\2/v/' \
211 --regex-c='/DEFINE_PER_CPU_SHARED_ALIGNED\(([^,]*,\s*)(\w*).*\)/\2/v/' \
212 --regex-c='/DECLARE_WAIT_QUEUE_HEAD\((\w*)/\1/v/' \
213 --regex-c='/DECLARE_(TASKLET|WORK|DELAYED_WORK)\((\w*)/\2/v/' \
214 --regex-c='/DEFINE_PCI_DEVICE_TABLE\((\w*)/\1/v/' \
215 --regex-c='/(^\s)OFFSET\((\w*)/\2/v/' \
216 --regex-c='/(^\s)DEFINE\((\w*)/\2/v/' \
217 --regex-c='/DEFINE_HASHTABLE\((\w*)/\1/v/'
218 263
264 setup_regex exuberant kconfig
219 all_kconfigs | xargs $1 -a \ 265 all_kconfigs | xargs $1 -a \
220 --langdef=kconfig --language-force=kconfig \ 266 --langdef=kconfig --language-force=kconfig "${regex[@]}"
221 --regex-kconfig='/^[[:blank:]]*(menu|)config[[:blank:]]+([[:alnum:]_]+)/\2/'
222 267
223 all_kconfigs | xargs $1 -a \
224 --langdef=kconfig --language-force=kconfig \
225 --regex-kconfig='/^[[:blank:]]*(menu|)config[[:blank:]]+([[:alnum:]_]+)/CONFIG_\2/'
226
227 all_defconfigs | xargs -r $1 -a \
228 --langdef=dotconfig --language-force=dotconfig \
229 --regex-dotconfig='/^#?[[:blank:]]*(CONFIG_[[:alnum:]_]+)/\1/'
230} 268}
231 269
232emacs() 270emacs()
233{ 271{
234 all_target_sources | xargs $1 -a \ 272 setup_regex emacs asm c
235 --regex='/^\(ENTRY\|_GLOBAL\)(\([^)]*\)).*/\2/' \ 273 all_target_sources | xargs $1 -a "${regex[@]}"
236 --regex='/^SYSCALL_DEFINE[0-9]?(\([^,)]*\).*/sys_\1/' \
237 --regex='/^COMPAT_SYSCALL_DEFINE[0-9]?(\([^,)]*\).*/compat_sys_\1/' \
238 --regex='/^TRACE_EVENT(\([^,)]*\).*/trace_\1/' \
239 --regex='/^TRACE_EVENT(\([^,)]*\).*/trace_\1_rcuidle/' \
240 --regex='/^DEFINE_EVENT([^,)]*, *\([^,)]*\).*/trace_\1/' \
241 --regex='/^DEFINE_EVENT([^,)]*, *\([^,)]*\).*/trace_\1_rcuidle/' \
242 --regex='/PAGEFLAG(\([^,)]*\).*/Page\1/' \
243 --regex='/PAGEFLAG(\([^,)]*\).*/SetPage\1/' \
244 --regex='/PAGEFLAG(\([^,)]*\).*/ClearPage\1/' \
245 --regex='/TESTSETFLAG(\([^,)]*\).*/TestSetPage\1/' \
246 --regex='/TESTPAGEFLAG(\([^,)]*\).*/Page\1/' \
247 --regex='/SETPAGEFLAG(\([^,)]*\).*/SetPage\1/' \
248 --regex='/__SETPAGEFLAG(\([^,)]*\).*/__SetPage\1/' \
249 --regex='/TESTCLEARFLAG(\([^,)]*\).*/TestClearPage\1/' \
250 --regex='/__TESTCLEARFLAG(\([^,)]*\).*/TestClearPage\1/' \
251 --regex='/CLEARPAGEFLAG(\([^,)]*\).*/ClearPage\1/' \
252 --regex='/__CLEARPAGEFLAG(\([^,)]*\).*/__ClearPage\1/' \
253 --regex='/__PAGEFLAG(\([^,)]*\).*/__SetPage\1/' \
254 --regex='/__PAGEFLAG(\([^,)]*\).*/__ClearPage\1/' \
255 --regex='/PAGEFLAG_FALSE(\([^,)]*\).*/Page\1/' \
256 --regex='/TESTSCFLAG(\([^,)]*\).*/TestSetPage\1/' \
257 --regex='/TESTSCFLAG(\([^,)]*\).*/TestClearPage\1/' \
258 --regex='/SETPAGEFLAG_NOOP(\([^,)]*\).*/SetPage\1/' \
259 --regex='/CLEARPAGEFLAG_NOOP(\([^,)]*\).*/ClearPage\1/' \
260 --regex='/__CLEARPAGEFLAG_NOOP(\([^,)]*\).*/__ClearPage\1/' \
261 --regex='/TESTCLEARFLAG_FALSE(\([^,)]*\).*/TestClearPage\1/' \
262 --regex='/TASK_PFA_TEST\([^,]*,\s*([^)]*)\)/task_\1/' \
263 --regex='/TASK_PFA_SET\([^,]*,\s*([^)]*)\)/task_set_\1/' \
264 --regex='/TASK_PFA_CLEAR\([^,]*,\s*([^)]*)\)/task_clear_\1/' \
265 --regex='/_PE(\([^,)]*\).*/PEVENT_ERRNO__\1/' \
266 --regex='/PCI_OP_READ(\([a-z]*[a-z]\).*[1-4])/pci_bus_read_config_\1/' \
267 --regex='/PCI_OP_WRITE(\([a-z]*[a-z]\).*[1-4])/pci_bus_write_config_\1/'\
268 --regex='/[^#]*DEFINE_HASHTABLE(\([^,)]*\)/\1/'
269
270 all_kconfigs | xargs $1 -a \
271 --regex='/^[ \t]*\(\(menu\)*config\)[ \t]+\([a-zA-Z0-9_]+\)/\3/'
272
273 all_kconfigs | xargs $1 -a \
274 --regex='/^[ \t]*\(\(menu\)*config\)[ \t]+\([a-zA-Z0-9_]+\)/CONFIG_\3/'
275 274
276 all_defconfigs | xargs -r $1 -a \ 275 setup_regex emacs kconfig
277 --regex='/^#?[ \t]?\(CONFIG_[a-zA-Z0-9_]+\)/\1/' 276 all_kconfigs | xargs $1 -a "${regex[@]}"
278} 277}
279 278
280xtags() 279xtags()