Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751985AbdHaXjZ (ORCPT ); Thu, 31 Aug 2017 19:39:25 -0400 Received: from mail-pg0-f50.google.com ([74.125.83.50]:35431 "EHLO mail-pg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751904AbdHaXjX (ORCPT ); Thu, 31 Aug 2017 19:39:23 -0400 X-Google-Smtp-Source: ADKCNb7nADRF2gQaMmkQrT2BU0uTQGInsNeuBvebdQT7n0aRCj3lvP92L9fhPKPp11DB5htxjewmFw== From: Kees Cook To: Thomas Gleixner Cc: Kees Cook , David Howells , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 30/31] appletalk: Remove unneeded synchronization Date: Thu, 31 Aug 2017 16:29:42 -0700 Message-Id: <1504222183-61202-31-git-send-email-keescook@chromium.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504222183-61202-1-git-send-email-keescook@chromium.org> References: <1504222183-61202-1-git-send-email-keescook@chromium.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1262 Lines: 43 The use of del_timer_sync() will make sure a timer is not rescheduled. As such, there is no need to add external signals to kill timers. In preparation for switching the timer callback argument to the timer pointer, this drops the .data argument since it doesn't serve a meaningful purpose here. Cc: David Howells Cc: netdev@vger.kernel.org Signed-off-by: Kees Cook --- drivers/net/appletalk/ltpc.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/net/appletalk/ltpc.c b/drivers/net/appletalk/ltpc.c index e4aa374caa4d..cc3dc9337eae 100644 --- a/drivers/net/appletalk/ltpc.c +++ b/drivers/net/appletalk/ltpc.c @@ -880,14 +880,10 @@ static void ltpc_poll(unsigned long l) } ltpc_poll_counter--; } - - if (!dev) - return; /* we've been downed */ /* poll 20 times per second */ idle(dev); ltpc_timer.expires = jiffies + HZ/20; - add_timer(<pc_timer); } @@ -1252,8 +1248,6 @@ static void __exit ltpc_cleanup(void) if(debug & DEBUG_VERBOSE) printk("unregister_netdev\n"); unregister_netdev(dev_ltpc); - ltpc_timer.data = 0; /* signal the poll routine that we're done */ - del_timer_sync(<pc_timer); if(debug & DEBUG_VERBOSE) printk("freeing irq\n"); -- 2.7.4