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 8 int untouched(int x) 9 { 10 return x * 3; 11 } 12 13 int changed(int x) 14 { 15 #ifdef PATCHED 16 return x + 2; 17 #else 18 return x + 1; 19 #endif 20 } 21