Skip to content

Commit

Permalink
locking/static_keys: Provide a selftest
Browse files Browse the repository at this point in the history
The 'jump label' self-test is in reality testing static keys - rename things
accordingly.

Also prettify the code in various places while at it.

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jason Baron <jbaron@akamai.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Shuah Khan <shuahkh@osg.samsung.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: benh@kernel.crashing.org
Cc: bp@alien8.de
Cc: davem@davemloft.net
Cc: ddaney@caviumnetworks.com
Cc: heiko.carstens@de.ibm.com
Cc: linux-kernel@vger.kernel.org
Cc: liuj97@gmail.com
Cc: luto@amacapital.net
Cc: michael@ellerman.id.au
Cc: rabin@rab.in
Cc: ralf@linux-mips.org
Cc: rostedt@goodmis.org
Cc: vbabka@suse.cz
Cc: will.deacon@arm.com
Link: http://lkml.kernel.org/r/0c091ecebd78a879ed8a71835d205a691a75ab4e.1438227999.git.jbaron@akamai.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Ingo Molnar committed Aug 3, 2015
1 parent 579e1ac commit 2bf9e0a
Show file tree
Hide file tree
Showing 8 changed files with 253 additions and 253 deletions.
6 changes: 3 additions & 3 deletions lib/Kconfig.debug
Original file line number Diff line number Diff line change
Expand Up @@ -1841,12 +1841,12 @@ config MEMTEST
memtest=17, mean do 17 test patterns.
If you are unsure how to answer this question, answer N.

config TEST_JUMP_LABEL
tristate "Test jump label"
config TEST_STATIC_KEYS
tristate "Test static keys"
default n
depends on m
help
Test jump labels.
Test the static key interfaces.

If unsure, say N.

Expand Down
4 changes: 2 additions & 2 deletions lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ obj-$(CONFIG_TEST_KSTRTOX) += test-kstrtox.o
obj-$(CONFIG_TEST_LKM) += test_module.o
obj-$(CONFIG_TEST_RHASHTABLE) += test_rhashtable.o
obj-$(CONFIG_TEST_USER_COPY) += test_user_copy.o
obj-$(CONFIG_TEST_JUMP_LABEL) += test_jump_label.o
obj-$(CONFIG_TEST_JUMP_LABEL) += test_jump_label_base.o
obj-$(CONFIG_TEST_STATIC_KEYS) += test_static_keys.o
obj-$(CONFIG_TEST_STATIC_KEYS) += test_static_key_base.o

ifeq ($(CONFIG_DEBUG_KOBJECT),y)
CFLAGS_kobject.o += -DDEBUG
Expand Down
225 changes: 0 additions & 225 deletions lib/test_jump_label.c

This file was deleted.

10 changes: 5 additions & 5 deletions lib/test_jump_label_base.c → lib/test_static_key_base.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Kernel module for testing jump labels.
* Kernel module for testing static keys.
*
* Copyright 2015 Akamai Technologies Inc. All Rights Reserved
*
Expand Down Expand Up @@ -47,7 +47,7 @@ static void invert_key(struct static_key *key)
static_key_enable(key);
}

static int __init test_jump_label_base_init(void)
static int __init test_static_key_base_init(void)
{
invert_key(&base_inv_old_true_key);
invert_key(&base_inv_old_false_key);
Expand All @@ -57,12 +57,12 @@ static int __init test_jump_label_base_init(void)
return 0;
}

static void __exit test_jump_label_base_exit(void)
static void __exit test_static_key_base_exit(void)
{
}

module_init(test_jump_label_base_init);
module_exit(test_jump_label_base_exit);
module_init(test_static_key_base_init);
module_exit(test_static_key_base_exit);

MODULE_AUTHOR("Jason Baron <jbaron@akamai.com>");
MODULE_LICENSE("GPL");
Loading

0 comments on commit 2bf9e0a

Please sign in to comment.