Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/mm: Remove have_store_indication static key

Whenever test_facility() is used with a constant facility
number the generated code is identical to a static branch.

Remove the extra initcall and static_branch_enable() handling for
have_store_indication, and use test_facility() directly.

Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>

authored by

Heiko Carstens and committed by
Vasily Gorbik
fb5bbcdc fa151887

+1 -12
+1 -12
arch/s390/mm/fault.c
··· 15 15 #include <linux/signal.h> 16 16 #include <linux/sched.h> 17 17 #include <linux/sched/debug.h> 18 - #include <linux/jump_label.h> 19 18 #include <linux/kernel.h> 20 19 #include <linux/errno.h> 21 20 #include <linux/string.h> ··· 45 46 #include <asm/uv.h> 46 47 #include "../kernel/entry.h" 47 48 48 - static DEFINE_STATIC_KEY_FALSE(have_store_indication); 49 - 50 - static int __init fault_init(void) 51 - { 52 - if (test_facility(75)) 53 - static_branch_enable(&have_store_indication); 54 - return 0; 55 - } 56 - early_initcall(fault_init); 57 - 58 49 /* 59 50 * Find out which address space caused the exception. 60 51 */ ··· 70 81 { 71 82 union teid teid = { .val = regs->int_parm_long }; 72 83 73 - if (static_branch_likely(&have_store_indication)) 84 + if (test_facility(75)) 74 85 return teid.fsi == TEID_FSI_STORE; 75 86 return false; 76 87 }