]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit5ab9412b7e0960b3b89d363a554ccbec068b3ccd
treebfb776c843ba2c9a01f77521c056ba338cfa5dca
parent0457d71079f005a99a47dfd43857b3e4967c6bdd
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