]> git.baikalelectronics.ru Git - kernel.git/commit
V4L/DVB: media: dvb/af9015, implement eeprom hashing
authorJiri Slaby <jslaby@suse.cz>
Fri, 22 Jan 2010 15:10:52 +0000 (12:10 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 26 Feb 2010 18:10:52 +0000 (15:10 -0300)
commit384d742e3aec3c8365b66e3b3847d8c9c32b1274
tree52ea3e4cdeae03ae444cd155ab96cf87e94c04c4
parent66b8362b5536c00935989e04603c900f3f47e690
V4L/DVB: media: dvb/af9015, implement eeprom hashing

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 is moved earlier to the flow, namely from
af9015_af9013_frontend_attach to af9015_read_config, so that
we can access the sum in af9015_read_config already.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Acked-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/dvb-usb/af9015.c
drivers/media/dvb/dvb-usb/af9015.h