From 85ae5aaecf399172339897e5691131e7a7beb8b6 Mon Sep 17 00:00:00 2001 From: Oliver Hartkopp Date: Fri, 29 May 2020 18:14:58 +0200 Subject: [PATCH] j1939acd: fix unused variable warning open_socket() has a parameter to provide a network device name which is properly assigned by its callers to s.intf in main(). Instead of using the callers value open_socket() directly accesses the global s.intf which generates an unused variable warning with clang. Fix this by using the provided parameter (no functional change). Signed-off-by: Oliver Hartkopp --- j1939acd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/j1939acd.c b/j1939acd.c index 7e92c69..924f929 100644 --- a/j1939acd.c +++ b/j1939acd.c @@ -200,7 +200,7 @@ static int open_socket(const char *device, uint64_t name) .addr = J1939_IDLE_ADDR, .pgn = J1939_NO_PGN, }, - .can_ifindex = if_nametoindex(s.intf), + .can_ifindex = if_nametoindex(device), }; if (s.verbose)