Re: [PATCH 1/4] media: dvb/af9015, implement eeprom hashing

2010-01-24 Thread Antti Palosaari
On 01/24/2010 06:35 PM, Jiri Slaby wrote: On 01/24/2010 05:16 PM, Antti Palosaari wrote: +af9015_config.eeprom_sum = 0; +for (reg = 0; reg< eeprom_size / sizeof(u32); reg++) { +af9015_config.eeprom_sum *= GOLDEN_RATIO_PRIME_32; +af9015_config.eeprom_sum += le32_to_cpu((

Re: [PATCH 1/4] media: dvb/af9015, implement eeprom hashing

2010-01-24 Thread Jiri Slaby
On 01/24/2010 05:16 PM, Antti Palosaari wrote: >> +af9015_config.eeprom_sum = 0; >> +for (reg = 0; reg< eeprom_size / sizeof(u32); reg++) { >> +af9015_config.eeprom_sum *= GOLDEN_RATIO_PRIME_32; >> +af9015_config.eeprom_sum += le32_to_cpu(((u32 *)eeprom)[reg]); >> +} >>

Re: [PATCH 1/4] media: dvb/af9015, implement eeprom hashing

2010-01-24 Thread Antti Palosaari
Hei, Comments below. On 01/22/2010 05:10 PM, Jiri Slaby wrote: We read the eeprom anyway for dumping. Switch the dumping to print_hex_dump_bytes and compute hash above that by hash = 0; for (u32 VAL) in (eeprom): hash *= GOLDEN_RATIO_PRIME_32 hash += VAL; // while preserving endinaness Th

[PATCH 1/4] media: dvb/af9015, implement eeprom hashing

2010-01-22 Thread Jiri Slaby
This will be useful for matching of IR tables later. We read the eeprom anyway for dumping. Switch the dumping to print_hex_dump_bytes and compute hash above that by hash = 0; for (u32 VAL) in (eeprom): hash *= GOLDEN_RATIO_PRIME_32 hash += VAL; // while preserving endinaness The computation