From patchwork Mon Aug 13 21:43:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 144048 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3558982ljj; Mon, 13 Aug 2018 14:43:57 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxF9acuhO2DPCT3Kyr0xa5Ea4SslJRXSgdfscSbeB9PoI5ElkC+GJmcoWso1A7TNokWXabT X-Received: by 2002:a65:5784:: with SMTP id b4-v6mr18869831pgr.315.1534196637279; Mon, 13 Aug 2018 14:43:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534196637; cv=none; d=google.com; s=arc-20160816; b=JYJCHmE2aK4u3bJTC/efX46AWhGVH/bY6YapIYkA2HgQM2IMoQsbaW8tDkk3DmlC6o +iS/C0stabWasi1/3COeVGBFvt5ECjez2mQwxGwPG9+fkR+80gzyRNKogdoRRwhlwdKM wabdQ4ZgZ2IU7vukBAZYQbPF6xKzzAY/sGHP/AoopscvtfSbvJ5vircCvNW3i8q/rieB EMatL5h3OrNArQfdKEAaQBj23NuC2V4K4BqjZKVulnPzWM+Q+xjMlvVvfjHZgOUtZOee pPNp3fiPFlwbovQFVEYBAs1dYJwdG+y38oQCCIGFX96ha7SmOAT/nAVxyQ7DX1wV7xmu ISfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=XG1EYHaU7TlnfeUAwGzo/5WcRT1x5nk5/VoaknN61jc=; b=J4ls49Wyzl9QLDvD6SFxupPpse4gasMZndL+U3cPUYTE28lISWjQLE1lkcCTtP0eNF 8Q7JRe0Z8UMQ5PthLwg5liaSGV2bii8r24sY6J0ChR0Fpt9zGFDL//JaWPyeKHw4dVxt 9/xdyc2hj/YySNcm6yiSaDmCHd4MpTxWVeHV1pnAbcgdfFlVp5xJzx3CjfDKgY4Hoti/ M4vwZ2xGzz4Cla73wNt/MVe8JYaKhu6qCNVCRnIQiEeczUluU2cySziAWCcdugJ2E8rQ RUzhDLtKLbAtzHTE6r70mbongB+mCG05l6ZOI7rOQOk728TBq2A1ZKK00u9jj1MGQv4B Hp+g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 15-v6si18057065pld.157.2018.08.13.14.43.57; Mon, 13 Aug 2018 14:43:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730806AbeHNA15 (ORCPT + 31 others); Mon, 13 Aug 2018 20:27:57 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:45439 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730027AbeHNA15 (ORCPT ); Mon, 13 Aug 2018 20:27:57 -0400 Received: from wuerfel.lan ([109.193.40.16]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.129]) with ESMTPA (Nemesis) id 0MEJGG-1feGwi0UFU-00FQmY; Mon, 13 Aug 2018 23:43:44 +0200 From: Arnd Bergmann To: "David S. Miller" , James Chapman , Guillaume Nault Cc: Arnd Bergmann , Lorenzo Bianconi , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] l2tp: fix unused function warning Date: Mon, 13 Aug 2018 23:43:05 +0200 Message-Id: <20180813214341.3333789-1-arnd@arndb.de> X-Mailer: git-send-email 2.18.0 X-Provags-ID: V03:K1:QUX99iiomjXNkWr3rDLS1PrwtsQ/ME2ixd+StRJ9a/yILXEi2MN IB6QK5Vop6DkAqdKc398hlBNmPAsWvSg4Kq/XkgMbInnhy/n8O3wcxFZ22ICz6p3tpLDhhW WHB3bp6OUcurcXKBOaLxFBXfITlG4scsozh1D0YaHpKRxGsPdGTExpXYiZCEkXegP5DtxNP cygZi8MCSqeXX+fdV3NDA== X-UI-Out-Filterresults: notjunk:1; V01:K0:n1VdRkNX6nA=:lkAO9MUC4kgcNq49NEp0zR czb7uYaHlMi/dKs0WyxQ+LjS62i7CB+7Mcmkr0y6gzxds8GDK38Vr+QajeI/L39OfvSyN7GXi yFTQt65Qe+ZGqaHz/ralIUeKOMGCgDJ0h5ymZLx1wpk4xIbSubf0CqDDB1UH8eswVhkyQJ1Qj ok/hq4+CzbuFXiouq+Mc4K9vEOD+DWA2eVroQIRqnGHRQjzv+vjfob9YkBegS8q/iGEDjSmSF MMXdSfYchI1nSk7+axNnBBak8buAhw61jh95R2vzUmdNEH1628aa8iy3OEB1l7nlOmkZ4hvg9 nY5O15yJgMTYBKzJhQbdG+bHi9Hf5437xEF7vYc+rRXumw/t9JRlBJWNA152se9EVDUrr2dEY ojvU1xI9B+MeaeNj3e7S9y9CcK8Jq1qy3Zylg0UHSAZaB8lSFe8V8OKzw8km+Y2HS68OzO5RC sV4f2tEp9MDZdDeOAFA9EaQkU1r23p0xfgqKpz1TMR7U9gTu2LSo4Wdg5hPsMEDACvjzpFP9N 8ltpzZAfGIMwZD2grOtDSWH4uhSCFSnWpXS7RVu/nPsNK2PVx3VlfEEeFDaVcNVsCFnAZUS4o 5zwCNQMNjzx60X18/wGZBVmw7gzGE1ekapiV6y0fPBauaKQs+comhjhjsvfR9b/FvG/NdO7i5 +7gP5wDSlcF3zIrzkKwNcXpTfBGEN29vsGrDaxOMiVujWJJE4K7ikNXreUhCkMZnrVEg= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Removing one of the callers of pppol2tp_session_get_sock caused a harmless warning in some configurations: net/l2tp/l2tp_ppp.c:142:21: 'pppol2tp_session_get_sock' defined but not used [-Wunused-function] Rather than adding another #ifdef here, using a proper IS_ENABLED() check makes the code more readable and avoids those warnings while letting the compiler figure out for itself which code is needed. This adds one pointer for the unused show() callback in struct l2tp_session, but that seems harmless. Fixes: b0e29063dcb3 ("l2tp: remove pppol2tp_session_ioctl()") Signed-off-by: Arnd Bergmann --- net/l2tp/l2tp_core.h | 2 -- net/l2tp/l2tp_eth.c | 7 ++----- net/l2tp/l2tp_ppp.c | 7 ++----- 3 files changed, 4 insertions(+), 12 deletions(-) -- 2.18.0 diff --git a/net/l2tp/l2tp_core.h b/net/l2tp/l2tp_core.h index 8480a0af973e..9c9afe94d389 100644 --- a/net/l2tp/l2tp_core.h +++ b/net/l2tp/l2tp_core.h @@ -118,9 +118,7 @@ struct l2tp_session { int (*build_header)(struct l2tp_session *session, void *buf); void (*recv_skb)(struct l2tp_session *session, struct sk_buff *skb, int data_len); void (*session_close)(struct l2tp_session *session); -#if IS_ENABLED(CONFIG_L2TP_DEBUGFS) void (*show)(struct seq_file *m, void *priv); -#endif uint8_t priv[0]; /* private data */ }; diff --git a/net/l2tp/l2tp_eth.c b/net/l2tp/l2tp_eth.c index 3728986ec885..8aadc4f3bb9e 100644 --- a/net/l2tp/l2tp_eth.c +++ b/net/l2tp/l2tp_eth.c @@ -199,7 +199,6 @@ static void l2tp_eth_delete(struct l2tp_session *session) } } -#if IS_ENABLED(CONFIG_L2TP_DEBUGFS) static void l2tp_eth_show(struct seq_file *m, void *arg) { struct l2tp_session *session = arg; @@ -219,7 +218,6 @@ static void l2tp_eth_show(struct seq_file *m, void *arg) dev_put(dev); } -#endif static void l2tp_eth_adjust_mtu(struct l2tp_tunnel *tunnel, struct l2tp_session *session, @@ -305,9 +303,8 @@ static int l2tp_eth_create(struct net *net, struct l2tp_tunnel *tunnel, session->recv_skb = l2tp_eth_dev_recv; session->session_close = l2tp_eth_delete; -#if IS_ENABLED(CONFIG_L2TP_DEBUGFS) - session->show = l2tp_eth_show; -#endif + if (IS_ENABLED(CONFIG_L2TP_DEBUGFS)) + session->show = l2tp_eth_show; spriv = l2tp_session_priv(session); diff --git a/net/l2tp/l2tp_ppp.c b/net/l2tp/l2tp_ppp.c index 62f2d3f1e431..04d9946dcdba 100644 --- a/net/l2tp/l2tp_ppp.c +++ b/net/l2tp/l2tp_ppp.c @@ -533,7 +533,6 @@ static int pppol2tp_create(struct net *net, struct socket *sock, int kern) return error; } -#if IS_ENABLED(CONFIG_L2TP_DEBUGFS) static void pppol2tp_show(struct seq_file *m, void *arg) { struct l2tp_session *session = arg; @@ -547,16 +546,14 @@ static void pppol2tp_show(struct seq_file *m, void *arg) sock_put(sk); } } -#endif static void pppol2tp_session_init(struct l2tp_session *session) { struct pppol2tp_session *ps; session->recv_skb = pppol2tp_recv; -#if IS_ENABLED(CONFIG_L2TP_DEBUGFS) - session->show = pppol2tp_show; -#endif + if (IS_ENABLED(CONFIG_L2TP_DEBUGFS)) + session->show = pppol2tp_show; ps = l2tp_session_priv(session); mutex_init(&ps->sk_lock);