Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 32089246 authored by Michael Mueller's avatar Michael Mueller Committed by Martin Schwidefsky
Browse files

s390/facility: decompose test_facility()



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: default avatarMichael Mueller <mimu@linux.vnet.ibm.com>
Acked-by: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 749d3f9c
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -13,6 +13,16 @@

#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
@@ -20,12 +30,7 @@
 */
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);
}

/**