From patchwork Tue Oct 18 21:21:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Linus_L=C3=BCssing?= X-Patchwork-Id: 16753 X-Patchwork-Delegate: sw@simonwunderlich.de Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id E1CA3830A0; Tue, 18 Oct 2016 23:21:32 +0200 (CEST) Authentication-Results: open-mesh.org; dmarc=none header.from=c0d3.blue Received-SPF: None (no SPF record) identity=mailfrom; client-ip=2a01:4f8:171:314c::100:a1; helo=mail.aperture-lab.de; envelope-from=linus.luessing@c0d3.blue; receiver=b.a.t.m.a.n@lists.open-mesh.org Authentication-Results: open-mesh.org; dmarc=none header.from=c0d3.blue Received: from mail.aperture-lab.de (mail.aperture-lab.de [IPv6:2a01:4f8:171:314c::100:a1]) by open-mesh.org (Postfix) with ESMTPS id 16D3C8309F for ; Tue, 18 Oct 2016 23:21:30 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.aperture-lab.de (Postfix) with ESMTP id 16B37E105F; Tue, 18 Oct 2016 23:21:30 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at aperture-lab.de Received: from mail.aperture-lab.de ([127.0.0.1]) by localhost (mail.aperture-lab.de [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id qa-MVtA9-7fC; Tue, 18 Oct 2016 23:21:29 +0200 (CEST) Received: from localhost (unknown [IPv6:2001:67c:2d50:0:c85:8cff:fe0f:63fe]) (Authenticated sender: linus.luessing@c0d3.blue) by mail.aperture-lab.de (Postfix) with ESMTPSA; Tue, 18 Oct 2016 23:21:29 +0200 (CEST) From: =?utf-8?q?Linus_L=C3=BCssing?= To: b.a.t.m.a.n@lists.open-mesh.org Date: Tue, 18 Oct 2016 23:21:25 +0200 Message-Id: <20161018212125.32010-1-linus.luessing@c0d3.blue> X-Mailer: git-send-email 2.9.3 MIME-Version: 1.0 Subject: [B.A.T.M.A.N.] [PATCH] batman-adv: compat: Substitute compat code for netlink constification X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" Substitutes the compat-patches approach for the netlink const changes to the prefered way of using compat-includes. Signed-off-by: Linus Lüssing --- compat-include/net/genetlink.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/compat-include/net/genetlink.h b/compat-include/net/genetlink.h index 72a8991..b195b47 100644 --- a/compat-include/net/genetlink.h +++ b/compat-include/net/genetlink.h @@ -28,6 +28,15 @@ #include +/* multicast groups */ +enum __batadv_netlink_multicast_groups { + __BATADV_NL_MCGRP_TPMETER, +}; + +static struct genl_multicast_group __batadv_netlink_mcgrps[] = { + [__BATADV_NL_MCGRP_TPMETER] = { .name = BATADV_NL_MCAST_GROUP_TPMETER }, +}; + struct batadv_genl_family { /* data handled by the actual kernel */ struct genl_family family; @@ -140,12 +149,14 @@ static inline int batadv_genl_register_family(struct genl_family *family) static inline int batadv_genl_register_family_with_ops_grps(struct genl_family *family, struct genl_ops *ops, size_t n_ops, - struct genl_multicast_group *mcgrps, + const struct genl_multicast_group *mcgrps, size_t n_mcgrps) { + BUILD_BUG_ON(ARRAY_SIZE(__batadv_netlink_mcgrps) != n_mcgrps); + family->ops = ops; family->n_ops = n_ops; - family->mcgrps = mcgrps; + family->mcgrps = __batadv_netlink_mcgrps; family->n_mcgrps = n_mcgrps; family->module = THIS_MODULE;