/* sw_ccheck() checks synchronization bits and computes checksum of nibbles.  */
static int sw_check(__u64 t)
/* sw_ccheck() checks synchronization bits and computes checksum of nibbles.  */
static int sw_check(__u64 t)
{
	unsigned char sum = 0;
	if ((t & 0x8080808080808080ULL) ^ 0x80)
		return -1;
	while (t) {
		sum += t & 0xf;
		t >>= 4;
	}
	return sum & 0xf;
}