On Sunday, May 19, 2013 19:52:25 Simon Wunderlich wrote:
On Sun, May 19, 2013 at 12:55:16PM +0200, Antonio Quartulli wrote:
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
v2:
- patch rebased on top of
"batman-adv: use VLAN_ETH_HLEN instead of sizeof(struct vlan_eth_hdr)"
v3:
- use __constant* for vlan_insert_tag() argument
v4:
- use htons instead of __constant_htons
Looks good, using htons is a lot better. :)
Acked-by: Simon Wunderlich siwu@hrz.tu-chemnitz.de
Applied in revision 4a4f6b9.
Thanks, Marek