xref: /linux/tools/objtool/tests/generic/fixtures/basic.c (revision 5b6dca02b3e2254d2fd5706d76d7ab4610a67296)
1 // SPDX-License-Identifier: GPL-2.0
2 /* One changed function and one unchanged function. */
3 
4 /* klp diff takes the object's module name from .modinfo */
5 static const char __modinfo[]
6 	__attribute__((section(".modinfo"), used, aligned(1))) = "\0name=vmlinux";
7 
untouched(int x)8 int untouched(int x)
9 {
10 	return x * 3;
11 }
12 
changed(int x)13 int changed(int x)
14 {
15 #ifdef PATCHED
16 	return x + 2;
17 #else
18 	return x + 1;
19 #endif
20 }
21