linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Wei Yang <richard.weiyang@gmail.com>
To: rppt@kernel.org, willy@infradead.org, Liam.Howlett@oracle.com,
	will@kernel.org, broonie@kernel.org, akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Wei Yang <richard.weiyang@gmail.com>
Subject: [PATCH 3/3] tools/testing: abstract two init.h into common include directory
Date: Fri, 12 Jul 2024 03:51:38 +0000	[thread overview]
Message-ID: <20240712035138.24674-3-richard.weiyang@gmail.com> (raw)
In-Reply-To: <20240712035138.24674-1-richard.weiyang@gmail.com>

Currently we have two test suits define its own init.h. This is a little
redundant.

Let's create a init.h in common include directory and merge these two
into it.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
CC: Mike Rapoport <rppt@kernel.org>
CC: "Liam R. Howlett" <Liam.Howlett@oracle.com>
---
 tools/include/linux/compiler.h                   |  4 ----
 tools/{testing/memblock => include}/linux/init.h | 14 +++++++++++---
 tools/testing/radix-tree/linux/init.h            |  2 --
 tools/testing/radix-tree/maple.c                 |  2 +-
 4 files changed, 12 insertions(+), 10 deletions(-)
 rename tools/{testing/memblock => include}/linux/init.h (81%)
 delete mode 100644 tools/testing/radix-tree/linux/init.h

diff --git a/tools/include/linux/compiler.h b/tools/include/linux/compiler.h
index 8a63a9913495..e0aaabd18a99 100644
--- a/tools/include/linux/compiler.h
+++ b/tools/include/linux/compiler.h
@@ -122,10 +122,6 @@
 # define unlikely(x)		__builtin_expect(!!(x), 0)
 #endif
 
-#ifndef __init
-# define __init
-#endif
-
 #include <linux/types.h>
 
 /*
diff --git a/tools/testing/memblock/linux/init.h b/tools/include/linux/init.h
similarity index 81%
rename from tools/testing/memblock/linux/init.h
rename to tools/include/linux/init.h
index bd74abc5cba6..7ed407976dda 100644
--- a/tools/testing/memblock/linux/init.h
+++ b/tools/include/linux/init.h
@@ -1,9 +1,17 @@
 /* SPDX-License-Identifier: GPL-2.0 */
-#ifndef _LINUX_INIT_H
-#define _LINUX_INIT_H
+#ifndef _TOOLS_LINUX_INIT_H_
+#define _TOOLS_LINUX_INIT_H_
 
 #include <linux/compiler.h>
 
+#ifndef __init
+# define __init
+#endif
+
+#ifndef __exit
+# define __exit
+#endif
+
 #define __section(section)              __attribute__((__section__(section)))
 
 #define __initconst
@@ -29,4 +37,4 @@ struct obs_kernel_param {
 #define early_param(str, fn)						\
 	__setup_param(str, fn, fn, 1)
 
-#endif
+#endif /*  _TOOLS_LINUX_INIT_H_ */
diff --git a/tools/testing/radix-tree/linux/init.h b/tools/testing/radix-tree/linux/init.h
deleted file mode 100644
index 81563c3dfce7..000000000000
--- a/tools/testing/radix-tree/linux/init.h
+++ /dev/null
@@ -1,2 +0,0 @@
-#define __init
-#define __exit
diff --git a/tools/testing/radix-tree/maple.c b/tools/testing/radix-tree/maple.c
index f1caf4bcf937..d6c72838652c 100644
--- a/tools/testing/radix-tree/maple.c
+++ b/tools/testing/radix-tree/maple.c
@@ -14,7 +14,7 @@
 #include "test.h"
 #include <stdlib.h>
 #include <time.h>
-#include "linux/init.h"
+#include <linux/init.h>
 
 #define module_init(x)
 #define module_exit(x)
-- 
2.34.1



  parent reply	other threads:[~2024-07-12  3:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-12  3:51 [PATCH 1/3] memblock tests: include memory_hotplug.h in mmzone.h as kernel dose Wei Yang
2024-07-12  3:51 ` [PATCH 2/3] memblock tests: include export.h in linkage.h " Wei Yang
2024-07-12  3:51 ` Wei Yang [this message]
2024-07-29  5:47 ` [PATCH 1/3] memblock tests: include memory_hotplug.h in mmzone.h " Mike Rapoport

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=20240712035138.24674-3-richard.weiyang@gmail.com \
    --to=richard.weiyang@gmail.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rppt@kernel.org \
    --cc=will@kernel.org \
    --cc=willy@infradead.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;
as well as URLs for NNTP newsgroup(s).