]> git.karo-electronics.de Git - linux-beck.git/commitdiff
s390/facility: decompose test_facility()
authorMichael Mueller <mimu@linux.vnet.ibm.com>
Thu, 20 Jun 2013 13:11:39 +0000 (15:11 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Wed, 26 Jun 2013 19:10:25 +0000 (21:10 +0200)
The patch decomposes the function test_facility() into its API
test_facility() and its implementation __test_facility(). This
allows to reuse the implementation with a different API.

Patch is used to prepare checkin of SIE satellite code.

Signed-off-by: Michael Mueller <mimu@linux.vnet.ibm.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/include/asm/facility.h

index 2ee66a65f2d4740572791c46b9cf42a9c4e65d51..0aa6a7ed95a35cc441f711b2ba92f2c69b1afdad 100644 (file)
 
 #define MAX_FACILITY_BIT (256*8)       /* stfle_fac_list has 256 bytes */
 
+static inline int __test_facility(unsigned long nr, void *facilities)
+{
+       unsigned char *ptr;
+
+       if (nr >= MAX_FACILITY_BIT)
+               return 0;
+       ptr = (unsigned char *) facilities + (nr >> 3);
+       return (*ptr & (0x80 >> (nr & 7))) != 0;
+}
+
 /*
  * The test_facility function uses the bit odering where the MSB is bit 0.
  * That makes it easier to query facility bits with the bit number as
  */
 static inline int test_facility(unsigned long nr)
 {
-       unsigned char *ptr;
-
-       if (nr >= MAX_FACILITY_BIT)
-               return 0;
-       ptr = (unsigned char *) &S390_lowcore.stfle_fac_list + (nr >> 3);
-       return (*ptr & (0x80 >> (nr & 7))) != 0;
+       return __test_facility(nr, &S390_lowcore.stfle_fac_list);
 }
 
 /**