With old kernels that don't have support for extended ack
the variable one is not used which will cause a compilation
failure:
drivers/net/tap/tap_netlink.c:48:6:
error: unused variable 'one' [-Werror=unused-variable]
  int one = 1;
      ^~~
cc1: all warnings being treated as errors
Fixes: f11e38d90980 ("net/tap: use netlink extended ack support")
Cc: step...@networkplumber.org

Signed-off-by: Raslan Darawsheh <rasl...@mellanox.com>
---
 drivers/net/tap/tap_netlink.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/tap/tap_netlink.c b/drivers/net/tap/tap_netlink.c
index a77486d8e..b73802b51 100644
--- a/drivers/net/tap/tap_netlink.c
+++ b/drivers/net/tap/tap_netlink.c
@@ -45,7 +45,9 @@ tap_nl_init(uint32_t nl_groups)
                .nl_family = AF_NETLINK,
                .nl_groups = nl_groups,
        };
+#ifdef NETLINK_EXT_ACK
        int one = 1;
+#endif
 
        fd = socket(AF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, NETLINK_ROUTE);
        if (fd < 0) {
-- 
2.26.0

Reply via email to