Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933979AbdCKAru (ORCPT ); Fri, 10 Mar 2017 19:47:50 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:34268 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933434AbdCKArd (ORCPT ); Fri, 10 Mar 2017 19:47:33 -0500 From: Geliang Tang To: Neil Horman , "David S. Miller" Cc: Geliang Tang , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] drop_monitor: use setup_timer Date: Sat, 11 Mar 2017 08:46:59 +0800 Message-Id: <03f9cf555a71fced65877c85e49fac7e880b338c.1489061285.git.geliangtang@gmail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <3afa5498142ef68256023257dad37b9f8352e65e.1489060803.git.geliangtang@gmail.com> References: <3afa5498142ef68256023257dad37b9f8352e65e.1489060803.git.geliangtang@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 831 Lines: 25 Use setup_timer() instead of init_timer() to simplify the code. Signed-off-by: Geliang Tang --- net/core/drop_monitor.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c index fb55327..70ccda2 100644 --- a/net/core/drop_monitor.c +++ b/net/core/drop_monitor.c @@ -412,9 +412,8 @@ static int __init init_net_drop_monitor(void) for_each_possible_cpu(cpu) { data = &per_cpu(dm_cpu_data, cpu); INIT_WORK(&data->dm_alert_work, send_dm_alert); - init_timer(&data->send_timer); - data->send_timer.data = (unsigned long)data; - data->send_timer.function = sched_send_work; + setup_timer(&data->send_timer, sched_send_work, + (unsigned long)data); spin_lock_init(&data->lock); reset_per_cpu_data(data); } -- 2.9.3