From patchwork Fri Mar 10 10:01:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arend van Spriel X-Patchwork-Id: 9615731 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 472E860415 for ; Fri, 10 Mar 2017 10:01:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 406A028703 for ; Fri, 10 Mar 2017 10:01:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3541C28710; Fri, 10 Mar 2017 10:01:49 +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 AE76B28703 for ; Fri, 10 Mar 2017 10:01:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934597AbdCJKBX (ORCPT ); Fri, 10 Mar 2017 05:01:23 -0500 Received: from lpdvrndsmtp01.broadcom.com ([192.19.229.170]:45303 "EHLO rnd-relay.smtp.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933511AbdCJKBU (ORCPT ); Fri, 10 Mar 2017 05:01:20 -0500 Received: from mail-irv-17.broadcom.com (mail-irv-17.lvn.broadcom.net [10.75.224.233]) by rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id 0964630C0F5; Fri, 10 Mar 2017 02:01:17 -0800 (PST) Received: from jenkins-cam-14.cam.broadcom.com (jenkins-cam-14.cam.broadcom.com [10.177.128.77]) by mail-irv-17.broadcom.com (Postfix) with ESMTP id B94C481E9C; Fri, 10 Mar 2017 02:01:16 -0800 (PST) Received: by jenkins-cam-14.cam.broadcom.com (Postfix, from userid 25152) id 19F79B84E60; Fri, 10 Mar 2017 10:01:16 +0000 (GMT) From: Arend van Spriel To: Johannes Berg Cc: backports@vger.kernel.org, Arend van Spriel Subject: [PATCH] backports: provide backport for setup_deferrable_timer() Date: Fri, 10 Mar 2017 10:01:10 +0000 Message-Id: <1489140070-29878-1-git-send-email-arend.vanspriel@broadcom.com> X-Mailer: git-send-email 1.9.1 Sender: backports-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since commit f8f118ceaa56 ("mac80211: Use setup_timer instead of init_timer") mac80211 needs setup_deferrable_timer() which is not available in older kernels. Provide a backport in linux/timer.h. Really need two flavors of backport to support up to 3.0 kernel. Signed-off-by: Arend van Spriel --- Hit another one last night so here it is. Regards, Arend --- backport/backport-include/linux/timer.h | 35 +++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 backport/backport-include/linux/timer.h diff --git a/backport/backport-include/linux/timer.h b/backport/backport-include/linux/timer.h new file mode 100644 index 0000000..df560a2 --- /dev/null +++ b/backport/backport-include/linux/timer.h @@ -0,0 +1,35 @@ +#ifndef _BACKPORT_TIMER_H +#define _BACKPORT_TIMER_H + +#include_next + +#ifndef setup_deferrable_timer +/* + * The TIMER_DEFERRABLE flag has not been around since 3.0 so + * two different backports are needed here. + */ +#ifdef TIMER_DEFERRABLE +#define setup_deferrable_timer(timer, fn, data) \ + __setup_timer((timer), (fn), (data), TIMER_DEFERRABLE) +#else +static inline void setup_deferrable_timer_key(struct timer_list *timer, + const char *name, + struct lock_class_key *key, + void (*func)(unsigned long), + unsigned long data) +{ + timer->function = func; + timer->data = data; + init_timer_deferrable_key(timer, name, key); +} +#define setup_deferrable_timer(timer, fn, data) \ + do { \ + static struct lock_class_key __key; \ + setup_deferrable_timer_key((timer), #timer, &__key, \ + (fn), (data)); \ + } while (0) +#endif + +#endif + +#endif /* _BACKPORT_TIMER_H */