Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Wei Yang and committed by
Mike Rapoport (Microsoft)
e2ae9cf3 d68c0817

+12 -10
-4
tools/include/linux/compiler.h
··· 126 126 # define unlikely(x) __builtin_expect(!!(x), 0) 127 127 #endif 128 128 129 - #ifndef __init 130 - # define __init 131 - #endif 132 - 133 129 #include <linux/types.h> 134 130 135 131 /*
+11 -3
tools/testing/memblock/linux/init.h tools/include/linux/init.h
··· 1 1 /* 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_ 4 4 5 5 #include <linux/compiler.h> 6 + 7 + #ifndef __init 8 + # define __init 9 + #endif 10 + 11 + #ifndef __exit 12 + # define __exit 13 + #endif 6 14 7 15 #define __section(section) __attribute__((__section__(section))) 8 16 ··· 37 29 #define early_param(str, fn) \ 38 30 __setup_param(str, fn, fn, 1) 39 31 40 - #endif 32 + #endif /* _TOOLS_LINUX_INIT_H_ */
-2
tools/testing/radix-tree/linux/init.h
··· 1 - #define __init 2 - #define __exit
+1 -1
tools/testing/radix-tree/maple.c
··· 14 14 #include "test.h" 15 15 #include <stdlib.h> 16 16 #include <time.h> 17 - #include "linux/init.h" 17 + #include <linux/init.h> 18 18 19 19 #define module_init(x) 20 20 #define module_exit(x)