From patchwork Sun Mar 4 22:57:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 10257889 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1C2A060365 for ; Sun, 4 Mar 2018 22:57:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 11B46237F1 for ; Sun, 4 Mar 2018 22:57:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 046DD274A3; Sun, 4 Mar 2018 22:57:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 69C0A237F1 for ; Sun, 4 Mar 2018 22:57:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932506AbeCDW5u (ORCPT ); Sun, 4 Mar 2018 17:57:50 -0500 Received: from mx2.mailbox.org ([80.241.60.215]:52086 "EHLO mx2.mailbox.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932487AbeCDW5q (ORCPT ); Sun, 4 Mar 2018 17:57:46 -0500 Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id BC9C740ECE; Sun, 4 Mar 2018 23:57:44 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172]) (amavisd-new, port 10030) with ESMTP id hprh0SG-4I9Y; Sun, 4 Mar 2018 23:57:43 +0100 (CET) From: Hauke Mehrtens To: backports@vger.kernel.org Cc: johannes@sipsolutions.net, Hauke Mehrtens Subject: [PATCH 02/14] compat: timer.h: Remove last parameters from DEFINE_TIMER Date: Sun, 4 Mar 2018 23:57:05 +0100 Message-Id: <20180304225717.20890-3-hauke@hauke-m.de> In-Reply-To: <20180304225717.20890-1-hauke@hauke-m.de> References: <20180304225717.20890-1-hauke@hauke-m.de> Sender: backports-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP DEFINE_TIMER only has 2 parameters since kernel commit 1d27e3e2252ba ("timer: Remove expires and data arguments from DEFINE_TIMER") which was added with kernel 4.15. Add a version which translates between the new and the old API. Signed-off-by: Hauke Mehrtens --- backport/backport-include/linux/timer.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backport/backport-include/linux/timer.h b/backport/backport-include/linux/timer.h index 9824ea6b..69590bb7 100644 --- a/backport/backport-include/linux/timer.h +++ b/backport/backport-include/linux/timer.h @@ -60,4 +60,11 @@ static inline void timer_setup(struct timer_list *timer, container_of(callback_timer, typeof(*var), timer_fieldname) #endif +#if LINUX_VERSION_IS_LESS(4,15,0) +#undef DEFINE_TIMER +#define DEFINE_TIMER(_name, _function) \ + struct timer_list _name = \ + __TIMER_INITIALIZER(_function, 0, 0, 0) +#endif + #endif /* _BACKPORT_TIMER_H */