1 // SPDX-License-Identifier: GPL-2.0 2 /* Function introduced by the patch. noinline keeps it from being folded. */ 3 4 static const char __modinfo[] 5 __attribute__((section(".modinfo"), used, aligned(1))) = "\0name=vmlinux"; 6 7 #ifdef PATCHED klp_new_helper(int x)8static __attribute__((noinline)) int klp_new_helper(int x) 9 { 10 return x * 7; 11 } 12 #endif 13 target(int x)14int target(int x) 15 { 16 #ifdef PATCHED 17 return klp_new_helper(x); 18 #else 19 return x; 20 #endif 21 } 22