]> git.baikalelectronics.ru Git - kernel.git/commit
batman-adv: fixed hash functions type to uint32_t instead of int
authorAntonio Quartulli <ordex@autistici.org>
Wed, 5 Oct 2011 15:05:25 +0000 (17:05 +0200)
committerSven Eckelmann <sven@narfation.org>
Sun, 20 Nov 2011 12:08:33 +0000 (13:08 +0100)
commit6edac8b1a23f801378facacc9b6c59de2dd5de3b
treeb260388317b5dc1f4a8c00493eea6ff30fb47652
parent460b409c734868e57b2b55d296a4eabe4b81e72c
batman-adv: fixed hash functions type to uint32_t instead of int

There are two reasons for this fix:
- the result of choose_orig() and vis_choose() is an index and therefore it can't
  be negative. Hence it is correct to make the return type unsigned too.

- sizeof(int) may not be the same on ALL the architectures. Since we plan to use
  choose_orig() as DHT hash function, we need to guarantee that, given the same
  argument, the result is the same. Then it is correct to explicitly express
  the size of the return type (and the second argument). Since the expected
  length is currently 4, uint32_t is the most convenient choice.

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
net/batman-adv/hash.c
net/batman-adv/hash.h
net/batman-adv/originator.c
net/batman-adv/originator.h
net/batman-adv/routing.c
net/batman-adv/translation-table.c
net/batman-adv/vis.c