]> git.baikalelectronics.ru Git - kernel.git/commit
batman-adv: Split batadv_iv_ogm_orig_del_if function
authorSven Eckelmann <sven@narfation.org>
Mon, 22 Feb 2016 21:56:34 +0000 (22:56 +0100)
committerAntonio Quartulli <a@unstable.cc>
Tue, 3 May 2016 18:22:03 +0000 (02:22 +0800)
commit378846c113818abd3ad8540d1f93b2bb732fbfec
tree8c4fab8cd7408ab40597db1f80df9540b8d528dd
parentb8587008a216ac96cac7c86652f37c323363e2ef
batman-adv: Split batadv_iv_ogm_orig_del_if function

batadv_iv_ogm_orig_del_if handles two different buffers bcast_own and
bcast_own_sum which should be resized. The error handling two for
allocating these buffers causes the complexity of this function. This can
be avoided completely when the function is split into a main function
handling the locking, freeing and call of the subfunctions.

The subfunction can then independently handle the resize of the buffers.
This also allows to easily reuse the old buffer (which always is larger) in
case a smaller buffer could not be allocated without increasing the code
complexity.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
net/batman-adv/bat_iv_ogm.c