s2e/source/s2e-linux-kernel/linux-4.9.3/drivers/net/ethernet/ti/davinci_emac.c
/**
 * hash_get - Calculate hash value from mac address
 * @addr: mac address to delete from hash table
 *
 * Calculates hash value from mac address
 *
 */
Calculate hash value from mac address
@addr: mac address to delete from hash table

Calculates hash value from mac address
Calculate hash value from mac address @addr : mac address to delete from hash table Calculates hash value from mac address
static u32 hash_get(u8 *addr)
{
	u32 hash;
	u8 tmpval;
	int cnt;
	hash = 0;
	for (cnt = 0; cnt < 2; cnt++) {
		tmpval = *addr++;
		hash ^= (tmpval >> 2) ^ (tmpval << 4);
		tmpval = *addr++;
		hash ^= (tmpval >> 4) ^ (tmpval << 2);
		tmpval = *addr++;
		hash ^= (tmpval >> 6) ^ (tmpval);
	}
	return hash & 0x3F;
}
static u32 hash_get ( u8 * addr ) { u32 hash ; u8 tmpval ; int cnt ; hash = 0 ; for ( cnt = 0 ; cnt < 2 ; cnt ++ ) { tmpval = * addr ++ ; hash ^= ( tmpval >> 2 ) ^ ( tmpval << 4 ) ; tmpval = * addr ++ ; hash ^= ( tmpval >> 4 ) ^ ( tmpval << 2 ) ; tmpval = * addr ++ ; hash ^= ( tmpval >> 6 ) ^ ( tmpval ) ; } return hash & 0x3F ; }
hash_get - Calculate hash value from mac address
 @addr: mac address to delete from hash table
hash_get - Calculate hash value from mac address @addr : mac address to delete from hash table