mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
Eliminate bad hash multipliers from hash_32() and hash_64()
The "simplified" prime multipliers made very bad hash functions, so get rid
of them. This completes the work of 689de1d6ca.
To avoid the inefficiency which was the motivation for the "simplified"
multipliers, hash_64() on 32-bit systems is changed to use a different
algorithm. It makes two calls to hash_32() instead.
drivers/media/usb/dvb-usb-v2/af9015.c uses the old GOLDEN_RATIO_PRIME_32
for some horrible reason, so it inherits a copy of the old definition.
Signed-off-by: George Spelvin <[email protected]>
Cc: Antti Palosaari <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
This commit is contained in:
parent
92d567740f
commit
ef703f49a6
2 changed files with 36 additions and 53 deletions
|
|
@ -398,6 +398,8 @@ error:
|
|||
}
|
||||
|
||||
#define AF9015_EEPROM_SIZE 256
|
||||
/* 2^31 + 2^29 - 2^25 + 2^22 - 2^19 - 2^16 + 1 */
|
||||
#define GOLDEN_RATIO_PRIME_32 0x9e370001UL
|
||||
|
||||
/* hash (and dump) eeprom */
|
||||
static int af9015_eeprom_hash(struct dvb_usb_device *d)
|
||||
|
|
|
|||
Loading…
Reference in a new issue