/* * Kernel module for testing static keys. * * Copyright 2015 Akamai Technologies Inc. All Rights Reserved * * Authors: * Jason Baron * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include #include /* old keys */ struct static_key base_old_true_key = STATIC_KEY_INIT_TRUE; EXPORT_SYMBOL_GPL(base_old_true_key); struct static_key base_inv_old_true_key = STATIC_KEY_INIT_TRUE; EXPORT_SYMBOL_GPL(base_inv_old_true_key); struct static_key base_old_false_key = STATIC_KEY_INIT_FALSE; EXPORT_SYMBOL_GPL(base_old_false_key); struct static_key base_inv_old_false_key = STATIC_KEY_INIT_FALSE; EXPORT_SYMBOL_GPL(base_inv_old_false_key); /* new keys */ DEFINE_STATIC_KEY_TRUE(base_true_key); EXPORT_SYMBOL_GPL(base_true_key); DEFINE_STATIC_KEY_TRUE(base_inv_true_key); EXPORT_SYMBOL_GPL(base_inv_true_key); DEFINE_STATIC_KEY_FALSE(base_false_key); EXPORT_SYMBOL_GPL(base_false_key); DEFINE_STATIC_KEY_FALSE(base_inv_false_key); EXPORT_SYMBOL_GPL(base_inv_false_key); static void invert_key(struct static_key *key) { if (static_key_enabled(key)) static_key_disable(key); else static_key_enable(key); } static int __init test_static_key_base_init(void) { invert_key(&base_inv_old_true_key); invert_key(&base_inv_old_false_key); invert_key(&base_inv_true_key.key); invert_key(&base_inv_false_key.key); return 0; } static void __exit test_static_key_base_exit(void) { } module_init(test_static_key_base_init); module_exit(test_static_key_base_exit); MODULE_AUTHOR("Jason Baron "); MODULE_LICENSE("GPL"); 22a49e4f7a0bfed0d6'>commitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-01-05 23:06:06 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-01-05 23:06:06 -0800
commit6989606a7224a2d5a925df22a49e4f7a0bfed0d6 (patch)
tree2fb686a4dea9a7f4beec97fde510f2840c8e06f9 /tools/perf/pmu-events/arch
parented40875dd4b4c7b5c991db9e06c984180ab0b3ce (diff)
parentbe29d20f3f5db1f0b4e49a4f6eeedf840e2bf9b1 (diff)
Merge branch 'stable-4.10' of git://git.infradead.org/users/pcmoore/audit
Pull audit fixes from Paul Moore: "Two small fixes relating to audit's use of fsnotify. The first patch plugs a leak and the second fixes some lock shenanigans. The patches are small and I banged on this for an afternoon with our testsuite and didn't see anything odd" * 'stable-4.10' of git://git.infradead.org/users/pcmoore/audit: audit: Fix sleep in atomic fsnotify: Remove fsnotify_duplicate_mark()
Diffstat (limited to 'tools/perf/pmu-events/arch')