From patchwork Wed Oct 4 23:26:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 9985961 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 86ECF602B8 for ; Wed, 4 Oct 2017 23:34:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 047AB28B9F for ; Wed, 4 Oct 2017 23:34:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E748B28BBE; Wed, 4 Oct 2017 23:34:30 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, 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 58EEA28B17 for ; Wed, 4 Oct 2017 23:34:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751226AbdJDXe1 (ORCPT ); Wed, 4 Oct 2017 19:34:27 -0400 Received: from mail-pg0-f48.google.com ([74.125.83.48]:50544 "EHLO mail-pg0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751250AbdJDX1z (ORCPT ); Wed, 4 Oct 2017 19:27:55 -0400 Received: by mail-pg0-f48.google.com with SMTP id p5so7323023pgn.7 for ; Wed, 04 Oct 2017 16:27:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DyYNDBB0laFeIDrnpi0e1qdhqriC7jebETEUFT84ZEo=; b=IvyM6BrfaeNhg/VB32LcMZospbasPr2CyrR8bEhLvW6o4MdZI9xfFASG5l08isyNVi aPQDG7h69eFq4Y5/U+zBrlxvsO7shNFGFuJ1bahmb5TC+HjOKmokcChFmRrAq4HuYqDj Vjhx1Zd1qMBY+NljKqk6UXeo21hIMF6LuN0yw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DyYNDBB0laFeIDrnpi0e1qdhqriC7jebETEUFT84ZEo=; b=ePHxISzlOV8mAJ6dVMRmQPbMegvtJv3IN7Oj2aO5hKcyUae1SE2zeg1rpvQ5k1rpB0 6paFmHOATVMQFKALqF3scdXkVLiwUz+4FQYrtnKkj4b2s3kcBlF5dQVFz8gwJ2ixbxiA e8jFL4+mew8ylbxJiTCvMVshkX32i8ThVLWWnrohXTcDUj2R4+MIX3IIOWum+bUckj1K N9yzoNQ86oC/+4nJ+r/Tcezi2Cnprwdn5Rw/S0Mgk3lBOFKG5ms+aCoCc3oaxiocqBXW dzdZP+Jb5MLZXhI/Vq7Z5HVdb2L9N5Zv5YUfDFcDw5P/6hg05B+ESyikKaeP52JSjRAu mFgw== X-Gm-Message-State: AHPjjUhFVBpdu/m+pMJDI+OJuTJk1+8s9eE/d1w5yvcCsbqDT0+DD9NK muzbiQggsaPJqNVotm5rEqlR9A== X-Google-Smtp-Source: AOwi7QBMAWkrUkoN3du1GXkkZX7IeAY0dkbCjGTtaxa5je9MS4QHOHA9mmq5mr3n12+Zm5W6WNuyQw== X-Received: by 10.101.80.140 with SMTP id r12mr19437032pgp.267.1507159675209; Wed, 04 Oct 2017 16:27:55 -0700 (PDT) Received: from www.outflux.net (173-164-112-133-Oregon.hfc.comcastbusiness.net. [173.164.112.133]) by smtp.gmail.com with ESMTPSA id w13sm7521100pgq.13.2017.10.04.16.27.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Oct 2017 16:27:51 -0700 (PDT) From: Kees Cook To: Thomas Gleixner Cc: Kees Cook , Chris Metcalf , netdev@vger.kernel.org, Andrew Morton , Arnd Bergmann , Benjamin Herrenschmidt , Geert Uytterhoeven , Greg Kroah-Hartman , Guenter Roeck , Harish Patil , Heiko Carstens , "James E.J. Bottomley" , John Stultz , Julian Wiedmann , Kalle Valo , Lai Jiangshan , Len Brown , Manish Chopra , Mark Gross , "Martin K. Petersen" , Martin Schwidefsky , Michael Ellerman , Michael Reed , Oleg Nesterov , Paul Mackerras , Pavel Machek , Petr Mladek , "Rafael J. Wysocki" , Ralf Baechle , Sebastian Reichel , Stefan Richter , Stephen Boyd , Sudip Mukherjee , Tejun Heo , Ursula Braun , Viresh Kumar , Wim Van Sebroeck , linux1394-devel@lists.sourceforge.net, linux-mips@linux-mips.org, linux-pm@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org, linux-watchdog@vger.kernel.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 04/13] timer: Remove init_timer_pinned() in favor of timer_setup() Date: Wed, 4 Oct 2017 16:26:58 -0700 Message-Id: <1507159627-127660-5-git-send-email-keescook@chromium.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1507159627-127660-1-git-send-email-keescook@chromium.org> References: <1507159627-127660-1-git-send-email-keescook@chromium.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This refactors the only users of init_timer_pinned() to use the new timer_setup() and from_timer(). Drops the definition of init_timer_pinned(). Cc: Chris Metcalf Cc: Thomas Gleixner Cc: netdev@vger.kernel.org Signed-off-by: Kees Cook Acked-by: David S. Miller --- drivers/net/ethernet/tile/tilepro.c | 9 ++++----- include/linux/timer.h | 2 -- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/tile/tilepro.c b/drivers/net/ethernet/tile/tilepro.c index 49ccee4b9aec..56d06282fbde 100644 --- a/drivers/net/ethernet/tile/tilepro.c +++ b/drivers/net/ethernet/tile/tilepro.c @@ -608,9 +608,9 @@ static void tile_net_schedule_egress_timer(struct tile_net_cpu *info) * ISSUE: Maybe instead track number of expected completions, and free * only that many, resetting to zero if "pending" is ever false. */ -static void tile_net_handle_egress_timer(unsigned long arg) +static void tile_net_handle_egress_timer(struct timer_list *t) { - struct tile_net_cpu *info = (struct tile_net_cpu *)arg; + struct tile_net_cpu *info = from_timer(info, t, egress_timer); struct net_device *dev = info->napi.dev; /* The timer is no longer scheduled. */ @@ -1004,9 +1004,8 @@ static void tile_net_register(void *dev_ptr) BUG(); /* Initialize the egress timer. */ - init_timer_pinned(&info->egress_timer); - info->egress_timer.data = (long)info; - info->egress_timer.function = tile_net_handle_egress_timer; + timer_setup(&info->egress_timer, tile_net_handle_egress_timer, + TIMER_PINNED); u64_stats_init(&info->stats.syncp); diff --git a/include/linux/timer.h b/include/linux/timer.h index b10c4bdc6fbd..9da903562ed4 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h @@ -128,8 +128,6 @@ static inline void init_timer_on_stack_key(struct timer_list *timer, #define init_timer(timer) \ __init_timer((timer), 0) -#define init_timer_pinned(timer) \ - __init_timer((timer), TIMER_PINNED) #define init_timer_deferrable(timer) \ __init_timer((timer), TIMER_DEFERRABLE)