memblock tests: include memory_hotplug.h in mmzone.h as kernel dose
PATCH 1/3 memblock tests: include memory_hotplug.h in mmzone.h as kernel dose
In kernel code, memory_hotplug.h is included in mmzone.h instead of in init.h. Let's sync with kernel.
This is a preparation for move init.h in common include directory.
--- tools/testing/memblock/linux/init.h | 1 - tools/testing/memblock/linux/mmzone.h | 1 + 2 files changed, 1 insertion(+), 1 deletion(-)
tools/testing/memblock/linux/init.h +0 -1
@@ -4,7 +4,6 @@#include <linux/compiler.h> #include <asm/export.h> -#include <linux/memory_hotplug.h> #define __section (section) __attribute__((__section__(section)))
tools/testing/memblock/linux/mmzone.h +1 -0
@@ -3,6 +3,7 @@#define _TOOLS_MMZONE_H#include <linux/atomic.h> +#include <linux/memory_hotplug.h> struct pglist_data *first_online_pgdat (void );struct pglist_data *next_online_pgdat (struct pglist_data *pgdat);
Signature · 1 line
2.34.1
PATCH 2/3 memblock tests: include export.h in linkage.h as kernel dose
In kernel code, linkage.h includes export.h. Let's sync with kernel.
This is a preparation for move init.h in common include directory.
--- tools/include/linux/linkage.h | 2 ++ tools/testing/memblock/linux/init.h | 1 - 2 files changed, 2 insertions(+), 1 deletion(-)
tools/include/linux/linkage.h +2 -0
@@ -1,4 +1,6 @@#ifndef _TOOLS_INCLUDE_LINUX_LINKAGE_H#define _TOOLS_INCLUDE_LINUX_LINKAGE_H +#include <linux/export.h> +#endif /* _TOOLS_INCLUDE_LINUX_LINKAGE_H */
tools/testing/memblock/linux/init.h +0 -1
@@ -3,7 +3,6 @@#define _LINUX_INIT_H#include <linux/compiler.h> -#include <asm/export.h> #define __section (section) __attribute__((__section__(section)))
Signature · 1 line
2.34.1
PATCH 3/3 tools/testing: abstract two init.h into common include directory
In reply to Wei YangCurrently 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.
---
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.htools/include/linux/compiler.h +0 -4
@@ -122,10 +122,6 @@# define unlikely (x) __builtin_expect(!!(x), 0)#endif -#ifndef __init -# define __init -#endif -#include <linux/types.h> /*
tools/include/linux/init.h renamed from tools/testing/memblock/linux/init.h +11 -3
@@ -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_ */
tools/testing/radix-tree/linux/init.h deleted +0 -2
@@ -1,2 +0,0 @@ -#define __init -#define __exit
tools/testing/radix-tree/maple.c +1 -1
@@ -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)
Signature · 1 line
2.34.1
Quoted 6 lines · Wei Yang
In kernel code,
memory_hotplug.his included inmmzone.hinstead of ininit.h. Let's sync with kernel.This is a preparation for move
init.hin common include directory.
Applied to for-next branch of memblock.git tree, thanks!
[1/3] memblock tests: include memory_hotplug.h in mmzone.h as kernel dose
commit: b6087e14abae4cef271e563d9e15df3a872c3646
[2/3] memblock tests: include export.h in linkage.h as kernel dose
commit: 5e45c26c128e59edf97f81434ea0364763da2a11
[3/3] tools/testing: abstract two init.h into common include directory
commit: f56de22145544aa1e6c922c8f3b37157c820c8e3tree: https://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock
branch: for-next
--
Sincerely yours,
Mike.