From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Brendan Higgins <brendanhiggins@google.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Peter Zijlstra <peterz@infradead.org>,
Alexey Dobriyan <adobriyan@gmail.com>,
Miguel Ojeda <ojeda@kernel.org>,
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
Herbert Xu <herbert@gondor.apana.org.au>,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
kunit-dev@googlegroups.com, linux-media@vger.kernel.org,
netdev@vger.kernel.org, bpf@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Ingo Molnar <mingo@redhat.com>, Will Deacon <will@kernel.org>,
Waiman Long <longman@redhat.com>,
Boqun Feng <boqun.feng@gmail.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Steven Rostedt <rostedt@goodmis.org>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
Yonghong Song <yhs@fb.com>,
John Fastabend <john.fastabend@gmail.com>,
KP Singh <kpsingh@kernel.org>, Thomas Graf <tgraf@suug.ch>,
Andrew Morton <akpm@linux-foundation.org>,
jic23@kernel.org, linux@rasmusvillemoes.dk
Subject: [PATCH v1 1/3] kernel.h: Don't pollute header with single user macros
Date: Tue, 13 Jul 2021 11:45:39 +0300 [thread overview]
Message-ID: <20210713084541.7958-1-andriy.shevchenko@linux.intel.com> (raw)
The COUNT_ARGS() and CONCATENATE() macros are used by a single user.
Let move them to it.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
include/linux/kernel.h | 7 -------
include/trace/bpf_probe.h | 7 +++++++
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 1b2f0a7e00d6..743d3c9a3227 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -476,13 +476,6 @@ ftrace_vprintk(const char *fmt, va_list ap)
static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
#endif /* CONFIG_TRACING */
-/* This counts to 12. Any more, it will return 13th argument. */
-#define __COUNT_ARGS(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _n, X...) _n
-#define COUNT_ARGS(X...) __COUNT_ARGS(, ##X, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)
-
-#define __CONCAT(a, b) a ## b
-#define CONCATENATE(a, b) __CONCAT(a, b)
-
/**
* container_of - cast a member of a structure out to the containing structure
* @ptr: the pointer to the member.
diff --git a/include/trace/bpf_probe.h b/include/trace/bpf_probe.h
index a23be89119aa..6f57c96f7dc3 100644
--- a/include/trace/bpf_probe.h
+++ b/include/trace/bpf_probe.h
@@ -27,6 +27,13 @@
#undef __perf_task
#define __perf_task(t) (t)
+/* This counts to 12. Any more, it will return 13th argument. */
+#define __COUNT_ARGS(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _n, X...) _n
+#define COUNT_ARGS(X...) __COUNT_ARGS(, ##X, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)
+
+#define __CONCAT(a, b) a ## b
+#define CONCATENATE(a, b) __CONCAT(a, b)
+
/* cast any integer, pointer, or small struct to u64 */
#define UINTTYPE(size) \
__typeof__(__builtin_choose_expr(size == 1, (u8)1, \
--
2.30.2
next reply other threads:[~2021-07-13 8:45 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-13 8:45 Andy Shevchenko [this message]
2021-07-13 8:45 ` [PATCH v1 2/3] kernel.h: Drop unneeded <linux/kernel.h> inclusion from other headers Andy Shevchenko
2021-07-13 8:45 ` [PATCH v1 3/3] kernel.h: Split out container_of() and typeof_memeber() macros Andy Shevchenko
2021-07-13 10:37 ` Greg Kroah-Hartman
2021-07-13 11:16 ` Andy Shevchenko
2021-07-13 11:23 ` Greg Kroah-Hartman
2021-07-13 12:19 ` Herbert Xu
2021-07-13 12:45 ` Andy Shevchenko
2021-07-13 13:58 ` David Laight
2021-07-13 18:39 ` Miguel Ojeda
2021-10-07 9:20 ` Andy Shevchenko
2021-10-07 10:00 ` Andy Shevchenko
2021-10-07 15:39 ` Miguel Ojeda
2021-10-07 15:55 ` Andy Shevchenko
2021-07-13 12:38 ` [PATCH v1 1/3] kernel.h: Don't pollute header with single user macros Peter Zijlstra
2021-07-13 12:42 ` Andy Shevchenko
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=20210713084541.7958-1-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=boqun.feng@gmail.com \
--cc=bpf@vger.kernel.org \
--cc=brendanhiggins@google.com \
--cc=daniel@iogearbox.net \
--cc=gregkh@linuxfoundation.org \
--cc=herbert@gondor.apana.org.au \
--cc=jic23@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=kafai@fb.com \
--cc=kpsingh@kernel.org \
--cc=kunit-dev@googlegroups.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=longman@redhat.com \
--cc=mchehab+huawei@kernel.org \
--cc=mchehab@kernel.org \
--cc=mingo@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=ojeda@kernel.org \
--cc=peterz@infradead.org \
--cc=rafael@kernel.org \
--cc=rostedt@goodmis.org \
--cc=sakari.ailus@linux.intel.com \
--cc=songliubraving@fb.com \
--cc=tgraf@suug.ch \
--cc=will@kernel.org \
--cc=yhs@fb.com \
/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;
as well as URLs for NNTP newsgroup(s).