]> git.baikalelectronics.ru Git - kernel.git/commit
batman-adv: use htons when possible
authorAntonio Quartulli <ordex@autistici.org>
Sun, 19 May 2013 10:55:16 +0000 (12:55 +0200)
committerAntonio Quartulli <antonio@meshcoding.com>
Sat, 12 Oct 2013 09:59:23 +0000 (11:59 +0200)
commit83a9e2b34e80ebb9d48259641dea158368e9181b
treeda710c595953f0442c0a2b18dd2f7723d8a5ee7d
parentf058d0a8b8cc412aecf3f9e1d40c56e67993e290
batman-adv: use htons when possible

When comparing a network ordered value with a constant, it
is better to convert the constant at compile time by means
of htons() instead of converting the value at runtime using
ntohs().

This refactoring may slightly improve the code performance.

Moreover substitute __constant_htons() with htons() since
the latter increase readability and it is smart enough to be
as efficient as the former

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Acked-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
net/batman-adv/bridge_loop_avoidance.c
net/batman-adv/gateway_client.c
net/batman-adv/hard-interface.c
net/batman-adv/send.c
net/batman-adv/soft-interface.c