From patchwork Thu May 5 07:44:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 16070 X-Patchwork-Delegate: mareklindner@neomailbox.ch 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 A7FB0824FC; Thu, 5 May 2016 09:44:59 +0200 (CEST) Authentication-Results: open-mesh.org; dmarc=none header.from=open-mesh.com Authentication-Results: open-mesh.org; dkim=fail reason="verification failed; unprotected key" header.d=open-mesh-com.20150623.gappssmtp.com header.i=@open-mesh-com.20150623.gappssmtp.com header.b=W/BehvOd; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received-SPF: Neutral (access neither permitted nor denied) identity=mailfrom; client-ip=2a00:1450:400c:c09::22b; helo=mail-wm0-x22b.google.com; envelope-from=sven.eckelmann@open-mesh.com; receiver=b.a.t.m.a.n@lists.open-mesh.org Authentication-Results: open-mesh.org; dmarc=none header.from=open-mesh.com Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) by open-mesh.org (Postfix) with ESMTPS id E009481A76 for ; Thu, 5 May 2016 09:44:56 +0200 (CEST) Received: by mail-wm0-x22b.google.com with SMTP id g17so13341681wme.1 for ; Thu, 05 May 2016 00:44:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=open-mesh-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id; bh=y/cYstJVpraUGxKn4bbtFBFravP6NXvyEnVJ2drGXyI=; b=W/BehvOdxN4+eXpIJ0sxPP86Xw+VTc6JuEoGNjZtONKPcCke11jEu+8m6hPOYZ/jng 4jIZ6BTYe6jzJB9TpeqlkqNWLE174vYeYINN3cie9JibdVLaHgPvf1sPqJKUNUn/Am3c tsC+RadJ7Qvw0rix/gFkETrbargGjA7FXPSC1hfUxeJwnb+d4fRACMZhzC5vyRjic1xc BspT5AqNmmEZ4MtlyelEbT7zwhZ7BClSdYzhnxqSMg0MsBcnglRYYmKPLuMfcnO+YyPT 0wTZPn2nzLjJJ7M3v+RyJ2DsmpTNRxab1mBNm1idhZ41pVXzHEAn+pitFlf4jTlfkIHF tlAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=y/cYstJVpraUGxKn4bbtFBFravP6NXvyEnVJ2drGXyI=; b=aLeuFnGcvBoHv9/mPo8neX60OsQpqOEb4NLwR/XGO+wq95eHajIk0lDZtXH0ITvnU+ LB8rPkKKVL6/Z/2OsWESOxMzFFaMicAR+6gWC47hKzJ7Zd0FceBfvbNYFSeAa8pV+jno b01yTxFegpJIOLe1CNpdQsQ2lPW5e7Dr8mfC1/m72Svz0m1xrP/INgijzqiFqkZF2Xnp 6lZEer/FktlErFhcrWNmQ1cQcbN8Fr22n2C5iCmJRhuKK43GZXYOFtN771usnIVTaZDG M2qakiZQAux8m2qcN0nA2XEz3Pc28RQDNtbEoOVAdOqPH2dNaQ3pamXYnMIf5t1Iy6ia pHjQ== X-Gm-Message-State: AOPr4FXR5dCA1fOpDhAxlaVVgfXID2Dg+PSGyRWz2WU1/WVblEsi6L4dDZ2orOD3q1Wzh8U9 X-Received: by 10.28.156.195 with SMTP id f186mr1781764wme.74.1462434295732; Thu, 05 May 2016 00:44:55 -0700 (PDT) Received: from sven-desktop.home.narfation.org (p200300C593C34EFD0000000000002E16.dip0.t-ipconnect.de. [2003:c5:93c3:4efd::2e16]) by smtp.gmail.com with ESMTPSA id u6sm8352112wjh.2.2016.05.05.00.44.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 May 2016 00:44:55 -0700 (PDT) From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Thu, 5 May 2016 09:44:42 +0200 Message-Id: <1462434282-3307-1-git-send-email-sven.eckelmann@open-mesh.com> X-Mailer: git-send-email 2.8.1 Subject: [B.A.T.M.A.N.] [PATCH next] batman-adv: replace dev->trans_start update with helper 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" From: Florian Westphal Replace all trans_start updates with netif_trans_update helper. change was done via spatch: struct net_device *d; @@ - d->trans_start = jiffies + netif_trans_update(d) Compile tested only. Signed-off-by: Florian Westphal Signed-off-by: Sven Eckelmann --- Warning: untested compat-include/linux/netdevice.h | 10 ++++++++++ net/batman-adv/soft-interface.c | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/compat-include/linux/netdevice.h b/compat-include/linux/netdevice.h index f47f5c3..fb5b519 100644 --- a/compat-include/linux/netdevice.h +++ b/compat-include/linux/netdevice.h @@ -74,4 +74,14 @@ #endif /* < KERNEL_VERSION(4, 5, 0) */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 7, 0) + +#define netif_trans_update batadv_netif_trans_update +static inline void batadv_netif_trans_update(struct net_device *dev) +{ + dev->trans_start = jiffies; +} + +#endif /* < KERNEL_VERSION(4, 7, 0) */ + #endif /* _NET_BATMAN_ADV_COMPAT_LINUX_NETDEVICE_H_ */ diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c index 31d1df2..b349287 100644 --- a/net/batman-adv/soft-interface.c +++ b/net/batman-adv/soft-interface.c @@ -207,7 +207,7 @@ static int batadv_interface_tx(struct sk_buff *skb, if (atomic_read(&bat_priv->mesh_state) != BATADV_MESH_ACTIVE) goto dropped; - soft_iface->trans_start = jiffies; + netif_trans_update(soft_iface); vid = batadv_get_vid(skb, 0); ethhdr = eth_hdr(skb);