From patchwork Thu Jun 30 08:44:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitoj Kaur Chawla X-Patchwork-Id: 642447 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3rgClf3K6yz9s48 for ; Thu, 30 Jun 2016 18:44:46 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=brJxzxCM; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932142AbcF3Iob (ORCPT ); Thu, 30 Jun 2016 04:44:31 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:36510 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751860AbcF3IoG (ORCPT ); Thu, 30 Jun 2016 04:44:06 -0400 Received: by mail-pf0-f196.google.com with SMTP id i123so6815573pfg.3; Thu, 30 Jun 2016 01:44:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=hllNCGHerA2JYFxqzg/UpqnSwwh7SIkngpYMAzBr5mE=; b=brJxzxCMgxpgaYOHabNt9Y07bt6a9lM21ZwD7Yqr6kiDo8QV59kdgD8RqS7LvCArsp 10dUD6USLJOTrhMwdRYNkY+T7pbQzJQhs3dw3FTj+Cgj1mvQWbXt6ppneOvO3JfB39JE uLqwbcGw+bfqfYG45A0tWX5P0wEZ/3IsBQRHgcwN1cNnmWYgoxrJ1ikSwjQirZ60hGYa sABebjOal9chK0d6A/ny+isfzah/ZO43IYitdvThMmPVUr5wyQzrDR+QSS76KHnu8a0v A9mAwIWag5U+X+FX5Gm//MsxGonTk5NzioPb4b6QG2Do0Vr6b+xzuDoq0JVP3zJGFtuJ 4zIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=hllNCGHerA2JYFxqzg/UpqnSwwh7SIkngpYMAzBr5mE=; b=f1m1bN5D2iD2QGrt/m8nSRd5UkV40N3AyQ/rX1OM3r6RFkko4fndimSsqLGsyHXMkv jd6xpafjklh2dmy4+tGu/7ZEloubDHla7jaR0XebeUNc2hrY8OMGGs8CurRH+4sLvBM0 nyt0Dm21tcnLOTzkC+UCwUayjdp8sGTBjpKGPvVoZZ2XRXUwx5Acc+B6TPmSDAUrBjQy tAy8hFRuFJZveAnTkd3PLb27/fearQjel47ID/wraUtX0xDeCpSdrGiNVWeAQVxYJ0Bf ueYMpu7g7nB2x0PBeZAo2oLFv6MYaJ1POAXUvo72GSRogMB15gFI2vmjlC1JhC3Nr3Fl 6HWw== X-Gm-Message-State: ALyK8tJ54+WUXWrmhBualD5NWKv4YzMF18m2L9ZRHozquusH9tunSzu/YAT9GZnM/LO0Rw== X-Received: by 10.98.112.196 with SMTP id l187mr19355886pfc.59.1467276245409; Thu, 30 Jun 2016 01:44:05 -0700 (PDT) Received: from localhost ([182.69.111.83]) by smtp.gmail.com with ESMTPSA id b67sm3627038pfg.85.2016.06.30.01.44.04 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 30 Jun 2016 01:44:04 -0700 (PDT) Date: Thu, 30 Jun 2016 14:14:01 +0530 From: Amitoj Kaur Chawla To: 3chas3@gmail.com, linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: julia.lawall@lip6.fr Subject: [PATCH] atm: horizon: Use setup_timer Message-ID: <20160630084401.GA5261@amitoj-Inspiron-3542> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Convert a call to init_timer and accompanying intializations of the timer's data and function fields to a call to setup_timer. The Coccinelle semantic patch that fixes this problem is as follows: @@ expression t,d,f,e1; identifier x1; statement S1; @@ ( -t.data = d; | -t.function = f; | -init_timer(&t); +setup_timer(&t,f,d); | -init_timer_on_stack(&t); +setup_timer_on_stack(&t,f,d); ) <... when != S1 t.x1 = e1; ...> Signed-off-by: Amitoj Kaur Chawla --- drivers/atm/horizon.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/atm/horizon.c b/drivers/atm/horizon.c index 527bbd5..5fc81e2 100644 --- a/drivers/atm/horizon.c +++ b/drivers/atm/horizon.c @@ -2795,9 +2795,7 @@ static int hrz_probe(struct pci_dev *pci_dev, dev->atm_dev->ci_range.vpi_bits = vpi_bits; dev->atm_dev->ci_range.vci_bits = 10-vpi_bits; - init_timer(&dev->housekeeping); - dev->housekeeping.function = do_housekeeping; - dev->housekeeping.data = (unsigned long) dev; + setup_timer(&dev->housekeeping, do_housekeeping, (unsigned long) dev); mod_timer(&dev->housekeeping, jiffies); out: