xref: /linux/tools/objtool/tests/generic/fixtures/klp_funcs.c (revision 12d5fc96ebbb3b948861805b32a4c3a96105ccd9)
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * Two changed functions and one untouched, so the patch's function list has a
4  * length worth checking and something that must not appear in it.
5  */
6 
7 static const char __modinfo[]
8 	__attribute__((section(".modinfo"), used, aligned(1))) = "\0name=vmlinux";
9 
10 int first(int x)
11 {
12 #ifdef PATCHED
13 	return x + 11;
14 #else
15 	return x + 1;
16 #endif
17 }
18 
19 int second(int x)
20 {
21 #ifdef PATCHED
22 	return x + 22;
23 #else
24 	return x + 2;
25 #endif
26 }
27 
28 int third(int x)
29 {
30 	return x + 3;
31 }
32