s390/facilites: use stfle_fac_list array size for MAX_FACILITY_BIT
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Mon, 20 Mar 2017 13:29:50 +0000 (14:29 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 May 2018 07:50:24 +0000 (09:50 +0200)
commit 6f5165e864d240d15675cc2fb5a369d57e1f60d0 upstream.

Use the actual size of the facility list array within the lowcore
structure for the MAX_FACILITY_BIT define instead of a comment which
states what this is good for. This makes it a bit harder to break
things.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/s390/include/asm/facility.h

index 7a8a1457dbb8553d3cf17dae7f105d808ad90d9a..5811e7849a2e0df815d429025568155d1e3bea47 100644 (file)
@@ -15,7 +15,7 @@
 #include <linux/preempt.h>
 #include <asm/lowcore.h>
 
-#define MAX_FACILITY_BIT (256*8)       /* stfle_fac_list has 256 bytes */
+#define MAX_FACILITY_BIT (sizeof(((struct lowcore *)0)->stfle_fac_list) * 8)
 
 static inline void __set_facility(unsigned long nr, void *facilities)
 {