selftests: txtimestamp: fix compilation issue
authorVadim Fedorenko <vfedorenko@novek.ru>
Thu, 4 Feb 2021 17:50:34 +0000 (20:50 +0300)
committerJakub Kicinski <kuba@kernel.org>
Fri, 5 Feb 2021 04:22:30 +0000 (20:22 -0800)
commit647b8dd5184665432cc8a2b5bca46a201f690c37
tree10358d0848879315a95cda6455bdd22fe5c0a101
parent8fd54a73b7cda11548154451bdb4bde6d8ff74c7
selftests: txtimestamp: fix compilation issue

PACKET_TX_TIMESTAMP is defined in if_packet.h but it is not included in
test. Include it instead of <netpacket/packet.h> otherwise the error of
redefinition arrives.
Also fix the compiler warning about ambiguous control flow by adding
explicit braces.

Fixes: 8fe2f761cae9 ("net-timestamp: expand documentation")
Suggested-by: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Signed-off-by: Vadim Fedorenko <vfedorenko@novek.ru>
Acked-by: Willem de Bruijn <willemb@google.com>
Link: https://lore.kernel.org/r/1612461034-24524-1-git-send-email-vfedorenko@novek.ru
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/txtimestamp.c