batman-adv: iv_ogm, Reduce code duplication
authorMarkus Pargmann <mpa@pengutronix.de>
Sun, 3 Jul 2016 09:07:14 +0000 (11:07 +0200)
committerSimon Wunderlich <sw@simonwunderlich.de>
Tue, 9 Aug 2016 05:54:31 +0000 (07:54 +0200)
commit57b125029c0483ae53abf6d5d26c3eaa1b521573
treebfb776c843ba2c9a01f77521c056ba338cfa5dca
parenta8d8d1de414ee4c393ba43dbbf01eaf21a4f47bd
batman-adv: iv_ogm, Reduce code duplication

The difference between tq1 and tq2 are calculated the same way in two
separate functions.

This patch moves the common code to a separate function
'batadv_iv_ogm_neigh_diff' which handles everything necessary. The other
two functions can then handle errors and use the difference directly.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
[sven@narfation.org: rebased on current version, initialize return variable
in batadv_iv_ogm_neigh_diff, add kerneldoc, convert to bool return type]
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
net/batman-adv/bat_iv_ogm.c