aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeiko Carstens2015-11-24 13:48:27 +0100
committerMartin Schwidefsky2015-12-18 14:59:23 +0100
commit6ab6c31a5450b73133e04c3976469d6d72f55df3 (patch)
treea9a07f28080e174b44deb196d9df64fb31c22c17
parent185edd4431f0dfd48a465e19ccc3280b08e9fa1a (diff)
s390/facilities: optimize test_facility()
test_facility() can be optimized for bits which must be set anyway, due to the check in head.S. This removes a couple of superfluous runtime checks. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r--arch/s390/include/asm/facility.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/s390/include/asm/facility.h b/arch/s390/include/asm/facility.h
index 007163f91856..09b406db7529 100644
--- a/arch/s390/include/asm/facility.h
+++ b/arch/s390/include/asm/facility.h
@@ -34,6 +34,12 @@ static inline int __test_facility(unsigned long nr, void *facilities)
*/
static inline int test_facility(unsigned long nr)
{
+ unsigned long facilities_als[] = { FACILITIES_ALS };
+
+ if (__builtin_constant_p(nr) && nr < sizeof(facilities_als) * 8) {
+ if (__test_facility(nr, &facilities_als))
+ return 1;
+ }
return __test_facility(nr, &S390_lowcore.stfle_fac_list);
}