Skip to content

Commit e2ae9cf

Browse files
RichardWeiYangrppt
authored andcommitted
tools/testing: abstract two init.h into common include directory
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> Link: https://lore.kernel.org/r/20240712035138.24674-3-richard.weiyang@gmail.com Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
1 parent d68c081 commit e2ae9cf

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

tools/include/linux/compiler.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,6 @@
126126
# define unlikely(x) __builtin_expect(!!(x), 0)
127127
#endif
128128

129-
#ifndef __init
130-
# define __init
131-
#endif
132-
133129
#include <linux/types.h>
134130

135131
/*

tools/testing/memblock/linux/init.h renamed to tools/include/linux/init.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
/* SPDX-License-Identifier: GPL-2.0 */
2-
#ifndef _LINUX_INIT_H
3-
#define _LINUX_INIT_H
2+
#ifndef _TOOLS_LINUX_INIT_H_
3+
#define _TOOLS_LINUX_INIT_H_
44

55
#include <linux/compiler.h>
66

7+
#ifndef __init
8+
# define __init
9+
#endif
10+
11+
#ifndef __exit
12+
# define __exit
13+
#endif
14+
715
#define __section(section) __attribute__((__section__(section)))
816

917
#define __initconst
@@ -29,4 +37,4 @@ struct obs_kernel_param {
2937
#define early_param(str, fn) \
3038
__setup_param(str, fn, fn, 1)
3139

32-
#endif
40+
#endif /* _TOOLS_LINUX_INIT_H_ */

tools/testing/radix-tree/linux/init.h

Lines changed: 0 additions & 2 deletions
This file was deleted.

tools/testing/radix-tree/maple.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include "test.h"
1515
#include <stdlib.h>
1616
#include <time.h>
17-
#include "linux/init.h"
17+
#include <linux/init.h>
1818

1919
#define module_init(x)
2020
#define module_exit(x)

0 commit comments

Comments
 (0)