selftests: txtimestamp: fix compilation issue
authorVadim Fedorenko <vfedorenko@novek.ru>
Thu, 4 Feb 2021 17:50:34 +0000 (20:50 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Feb 2021 09:35:17 +0000 (10:35 +0100)
commitc0daa74b8ed74c70a76b9bca33c0b7c6796876c0
treea3226db0d0bd5cf6b7390aad6b6b47785c1e3015
parent6107338c2fa2ee6264fc26e50462061377e4d4f3
selftests: txtimestamp: fix compilation issue

[ Upstream commit 647b8dd5184665432cc8a2b5bca46a201f690c37 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/networking/timestamping/txtimestamp.c