mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michal Marek <mmarek@suse.com>
To: linux-kbuild@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH v2 1/8] tags: Treat header files as C code
Date: Fri,  4 Dec 2015 16:26:20 +0100	[thread overview]
Message-ID: <1449242787-16598-2-git-send-email-mmarek@suse.com> (raw)
In-Reply-To: <1449242787-16598-1-git-send-email-mmarek@suse.com>

This allows to apply the same patters to both source and header files.
The effect is mostly visible in the case of DECLARE_BITMAP, but there
are small gains all over the place. There is also lots of random changes
in the diff, I believe this is simply because there are still lots of
unexpanded macros in the code and the C and C++ parsers fail and recover
at different points. Also, qconf.h is parsed as C, but that's a
negligible regression.

Signed-off-by: Michal Marek <mmarek@suse.com>
---
v2: Rebased on current linux-next

 scripts/tags.sh | 64 ++++++++++++++++++++++++++++-----------------------------
 1 file changed, 32 insertions(+), 32 deletions(-)

diff --git a/scripts/tags.sh b/scripts/tags.sh
index 3df83161da56..abcf43eed874 100755
--- a/scripts/tags.sh
+++ b/scripts/tags.sh
@@ -165,41 +165,41 @@ exuberant()
 	-I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL,ACPI_EXPORT_SYMBOL   \
 	-I DEFINE_TRACE,EXPORT_TRACEPOINT_SYMBOL,EXPORT_TRACEPOINT_SYMBOL_GPL \
 	-I static,const						\
-	--extra=+f --c-kinds=+px                                \
+	--extra=+f --c-kinds=+px --langmap=c:+.h                \
 	--regex-asm='/^(ENTRY|_GLOBAL)\(([^)]*)\).*/\2/'        \
 	--regex-c='/^SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/sys_\1/' \
 	--regex-c='/^COMPAT_SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/compat_sys_\1/' \
-	--regex-c++='/^TRACE_EVENT\(([^,)]*).*/trace_\1/'		\
-	--regex-c++='/^TRACE_EVENT\(([^,)]*).*/trace_\1_rcuidle/'	\
-	--regex-c++='/^DEFINE_EVENT\([^,)]*, *([^,)]*).*/trace_\1/'	\
-	--regex-c++='/^DEFINE_EVENT\([^,)]*, *([^,)]*).*/trace_\1_rcuidle/' \
-	--regex-c++='/PAGEFLAG\(([^,)]*).*/Page\1/'			\
-	--regex-c++='/PAGEFLAG\(([^,)]*).*/SetPage\1/'			\
-	--regex-c++='/PAGEFLAG\(([^,)]*).*/ClearPage\1/'		\
-	--regex-c++='/TESTSETFLAG\(([^,)]*).*/TestSetPage\1/'		\
-	--regex-c++='/TESTPAGEFLAG\(([^,)]*).*/Page\1/'			\
-	--regex-c++='/SETPAGEFLAG\(([^,)]*).*/SetPage\1/'		\
-	--regex-c++='/__SETPAGEFLAG\(([^,)]*).*/__SetPage\1/'		\
-	--regex-c++='/TESTCLEARFLAG\(([^,)]*).*/TestClearPage\1/'	\
-	--regex-c++='/__TESTCLEARFLAG\(([^,)]*).*/TestClearPage\1/'	\
-	--regex-c++='/CLEARPAGEFLAG\(([^,)]*).*/ClearPage\1/'		\
-	--regex-c++='/__CLEARPAGEFLAG\(([^,)]*).*/__ClearPage\1/'	\
-	--regex-c++='/__PAGEFLAG\(([^,)]*).*/__SetPage\1/'		\
-	--regex-c++='/__PAGEFLAG\(([^,)]*).*/__ClearPage\1/'		\
-	--regex-c++='/PAGEFLAG_FALSE\(([^,)]*).*/Page\1/'		\
-	--regex-c++='/TESTSCFLAG\(([^,)]*).*/TestSetPage\1/'		\
-	--regex-c++='/TESTSCFLAG\(([^,)]*).*/TestClearPage\1/'		\
-	--regex-c++='/SETPAGEFLAG_NOOP\(([^,)]*).*/SetPage\1/'		\
-	--regex-c++='/CLEARPAGEFLAG_NOOP\(([^,)]*).*/ClearPage\1/'	\
-	--regex-c++='/__CLEARPAGEFLAG_NOOP\(([^,)]*).*/__ClearPage\1/'	\
-	--regex-c++='/TESTCLEARFLAG_FALSE\(([^,)]*).*/TestClearPage\1/' \
-	--regex-c++='/_PE\(([^,)]*).*/PEVENT_ERRNO__\1/'		\
-	--regex-c++='/TASK_PFA_TEST\([^,]*,\s*([^)]*)\)/task_\1/'	\
-	--regex-c++='/TASK_PFA_SET\([^,]*,\s*([^)]*)\)/task_set_\1/'	\
-	--regex-c++='/TASK_PFA_CLEAR\([^,]*,\s*([^)]*)\)/task_clear_\1/'\
-	--regex-c++='/DEF_MMIO_(IN|OUT)_(X|D)\(([^,]*),\s*[^)]*\)/\3/'	\
-	--regex-c++='/DEBUGGER_BOILERPLATE\(([^,]*)\)/\1/'		\
-	--regex-c++='/DEF_PCI_AC_(NO)?RET\(([^,]*),.*/\2/'		\
+	--regex-c='/^TRACE_EVENT\(([^,)]*).*/trace_\1/'			\
+	--regex-c='/^TRACE_EVENT\(([^,)]*).*/trace_\1_rcuidle/'		\
+	--regex-c='/^DEFINE_EVENT\([^,)]*, *([^,)]*).*/trace_\1/'	\
+	--regex-c='/^DEFINE_EVENT\([^,)]*, *([^,)]*).*/trace_\1_rcuidle/' \
+	--regex-c='/PAGEFLAG\(([^,)]*).*/Page\1/'			\
+	--regex-c='/PAGEFLAG\(([^,)]*).*/SetPage\1/'			\
+	--regex-c='/PAGEFLAG\(([^,)]*).*/ClearPage\1/'			\
+	--regex-c='/TESTSETFLAG\(([^,)]*).*/TestSetPage\1/'		\
+	--regex-c='/TESTPAGEFLAG\(([^,)]*).*/Page\1/'			\
+	--regex-c='/SETPAGEFLAG\(([^,)]*).*/SetPage\1/'			\
+	--regex-c='/__SETPAGEFLAG\(([^,)]*).*/__SetPage\1/'		\
+	--regex-c='/TESTCLEARFLAG\(([^,)]*).*/TestClearPage\1/'		\
+	--regex-c='/__TESTCLEARFLAG\(([^,)]*).*/TestClearPage\1/'	\
+	--regex-c='/CLEARPAGEFLAG\(([^,)]*).*/ClearPage\1/'		\
+	--regex-c='/__CLEARPAGEFLAG\(([^,)]*).*/__ClearPage\1/'		\
+	--regex-c='/__PAGEFLAG\(([^,)]*).*/__SetPage\1/'		\
+	--regex-c='/__PAGEFLAG\(([^,)]*).*/__ClearPage\1/'		\
+	--regex-c='/PAGEFLAG_FALSE\(([^,)]*).*/Page\1/'			\
+	--regex-c='/TESTSCFLAG\(([^,)]*).*/TestSetPage\1/'		\
+	--regex-c='/TESTSCFLAG\(([^,)]*).*/TestClearPage\1/'		\
+	--regex-c='/SETPAGEFLAG_NOOP\(([^,)]*).*/SetPage\1/'		\
+	--regex-c='/CLEARPAGEFLAG_NOOP\(([^,)]*).*/ClearPage\1/'	\
+	--regex-c='/__CLEARPAGEFLAG_NOOP\(([^,)]*).*/__ClearPage\1/'	\
+	--regex-c='/TESTCLEARFLAG_FALSE\(([^,)]*).*/TestClearPage\1/' \
+	--regex-c='/_PE\(([^,)]*).*/PEVENT_ERRNO__\1/'		\
+	--regex-c='/TASK_PFA_TEST\([^,]*,\s*([^)]*)\)/task_\1/'	\
+	--regex-c='/TASK_PFA_SET\([^,]*,\s*([^)]*)\)/task_set_\1/'	\
+	--regex-c='/TASK_PFA_CLEAR\([^,]*,\s*([^)]*)\)/task_clear_\1/'\
+	--regex-c='/DEF_MMIO_(IN|OUT)_(X|D)\(([^,]*),\s*[^)]*\)/\3/'	\
+	--regex-c='/DEBUGGER_BOILERPLATE\(([^,]*)\)/\1/'		\
+	--regex-c='/DEF_PCI_AC_(NO)?RET\(([^,]*),.*/\2/'		\
 	--regex-c='/PCI_OP_READ\((\w*).*[1-4]\)/pci_bus_read_config_\1/' \
 	--regex-c='/PCI_OP_WRITE\((\w*).*[1-4]\)/pci_bus_write_config_\1/' \
 	--regex-c='/DEFINE_(MUTEX|SEMAPHORE|SPINLOCK)\((\w*)/\2/v/'	\
-- 
2.1.4


  reply	other threads:[~2015-12-04 15:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-04 15:26 [PATCH v2 0/8] scripts/tags.sh cleanup Michal Marek
2015-12-04 15:26 ` Michal Marek [this message]
2015-12-04 15:26 ` [PATCH v2 2/8] aic7xxx: Avoid name collision with <linux/list.h> Michal Marek
2015-12-04 15:26 ` [PATCH v2 3/8] tags: Fix erroneous pattern match in a comment Michal Marek
2015-12-04 15:26 ` [PATCH v2 4/8] tags: Process Kconfig files in a single pass Michal Marek
2015-12-04 15:26 ` [PATCH v2 5/8] tags: Do not try to index defconfigs Michal Marek
2015-12-04 15:26 ` [PATCH v2 6/8] tags: Drop the _PE rule Michal Marek
2015-12-04 15:26 ` [PATCH v2 7/8] tags: Unify emacs and exuberant rules Michal Marek
2016-01-05 21:51   ` Michal Marek
2015-12-04 15:26 ` [PATCH v2 8/8] treewide: Remove newlines inside DEFINE_PER_CPU() macros Michal Marek
2015-12-07 16:33   ` David Laight
2015-12-07 16:53     ` Michal Marek
2015-12-07 17:04       ` Joe Perches
2015-12-07 17:19         ` Michal Marek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1449242787-16598-2-git-send-email-mmarek@suse.com \
    --to=mmarek@suse.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®