From patchwork Thu Feb 18 17:26:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 15809 Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [127.0.0.1]) by open-mesh.org (Postfix) with ESMTP id 2AA5E82395; Thu, 18 Feb 2016 18:27:46 +0100 (CET) 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=RhwfZES0; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received-SPF: Neutral (access neither permitted nor denied) identity=mailfrom; client-ip=74.125.82.47; helo=mail-wm0-f47.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-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) by open-mesh.org (Postfix) with ESMTPS id 4CDB282360 for ; Thu, 18 Feb 2016 18:27:36 +0100 (CET) Received: by mail-wm0-f47.google.com with SMTP id a4so35924967wme.1 for ; Thu, 18 Feb 2016 09:27:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=open-mesh-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=K+o3AcEd5h4U0jwK3W9bSvXg99NWj4s2HYevR1YcsiU=; b=RhwfZES01Cff5wLlky+ZGbheEStTv/nJ3XbjaopnXNKWxX6xxFbpbIf4bJ6OzlZKMe OfDjG3H7cOI5aZtNx7sW+41Jb71pkGbNLEIB9YWxIl4oENBxhKvVXB+uWup188yG6SGy KTWRURrUQ+H+wgqpHUQRCCei0ylFdAWXb0gc9rq5qv2fFvC720aRSlmpciaj9cCEhztc Rlz7EGDSShd+YBQj6Edve/LguKS2M1hYpYjhbX+xOhW//8SI5cADqajmBNU2ZuZqMqKk rNS7jImdoYvJPV5ToU+KNubE1xOmVeuY3uXdDr3Ev8YoH3m1qsv74wYLTKSxDgCRTKQk Q+vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=K+o3AcEd5h4U0jwK3W9bSvXg99NWj4s2HYevR1YcsiU=; b=axkztjlyYBvQYpr4NuyLPrwaIFavlp0a6mi9a1rzCwgxfInVJlsDwxwaG9cht0VHGK 7++Ms1ABzj34l6gOQIYoOqAY9rGjY7kPQMdbBi841ObH6titRUzfa36VGNIQnC+ffj5E HyInSiHTYgbFf2o72oDKl3rDrm6Vz9uTdphKdHhbVLe0wQN3820gTKdJkwncf6HA60ZC musQr+ZJo/yWTw2FEa1XsX3LF9ftnNYn9Dzfshe7mx7hl9Pq/41C+FuU0soRa7H6knot loHI92OiQHsugvFPLg8M9yPElLWYR8Pyy50Es3oU65/sc0NMdFs1pMWUvJBEb33WCEWG mmXg== X-Gm-Message-State: AG10YOREAzOQW1Mt0Pkp+b8NxJ5wI32Yxb1J+fvtl/IrXGp1K+SVNDFL8M2VSCDo2TT1azqS X-Received: by 10.28.23.5 with SMTP id 5mr4740400wmx.82.1455816455998; Thu, 18 Feb 2016 09:27:35 -0800 (PST) Received: from sven-desktop.home.narfation.org (x4d05eef1.dyn.telefonica.de. [77.5.238.241]) by smtp.gmail.com with ESMTPSA id v1sm7451737wjf.49.2016.02.18.09.27.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Feb 2016 09:27:35 -0800 (PST) From: Sven Eckelmann X-Google-Original-From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Thu, 18 Feb 2016 18:26:54 +0100 Message-Id: <1455816416-24942-3-git-send-email-sven@open-mesh.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455816416-24942-1-git-send-email-sven@open-mesh.com> References: <6595687.FqdJJADTWg@bentobox> <1455816416-24942-1-git-send-email-sven@open-mesh.com> Cc: Edo Monticelli , Sven Eckelmann Subject: [B.A.T.M.A.N.] [RFC 3/5] batman-adv: Add compatibility code for to_delayed_work 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: Sven Eckelmann Signed-off-by: Sven Eckelmann --- compat-include/linux/workqueue.h | 46 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 compat-include/linux/workqueue.h diff --git a/compat-include/linux/workqueue.h b/compat-include/linux/workqueue.h new file mode 100644 index 0000000..85a41df --- /dev/null +++ b/compat-include/linux/workqueue.h @@ -0,0 +1,46 @@ +/* Copyright (C) 2007-2016 B.A.T.M.A.N. contributors: + * + * Marek Lindner, Simon Wunderlich + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + * + * This file contains macros for maintaining compatibility with older versions + * of the Linux kernel. + */ + +#ifndef _NET_BATMAN_ADV_COMPAT_LINUX_WORKQUEUE_H_ +#define _NET_BATMAN_ADV_COMPAT_LINUX_WORKQUEUE_H_ + +#include +#include_next + +#include + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 30) + +/* some stable versions like Linux 3.2.44 also introduced this function + * and would therefore break the build because they trigger a redefinition + * of this function. Instead rename this function to be in the batadv_* + * namespace + */ +#define to_delayed_work(__work) batadv_to_delayed_work(__work) + +static inline struct delayed_work * +batadv_to_delayed_work(struct work_struct *work) +{ + return container_of(work, struct delayed_work, work); +} + +#endif /* < KERNEL_VERSION(2, 6, 30) */ + +#endif /* _NET_BATMAN_ADV_COMPAT_LINUX_WORKQUEUE_H_ */