From patchwork Thu Sep 28 20:16:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Jha X-Patchwork-Id: 9976737 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 6D57660365 for ; Thu, 28 Sep 2017 20:16:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E9A829735 for ; Thu, 28 Sep 2017 20:16:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5378E29737; Thu, 28 Sep 2017 20:16:48 +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=-0.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_BL_SPAMCOP_NET,RCVD_IN_DNSWL_HI, RCVD_IN_SBL_CSS,RCVD_IN_SORBS_SPAM,RCVD_IN_SORBS_WEB,T_DKIM_INVALID autolearn=no 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 02A5429735 for ; Thu, 28 Sep 2017 20:16:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750821AbdI1UQr (ORCPT ); Thu, 28 Sep 2017 16:16:47 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:32842 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751154AbdI1UQq (ORCPT ); Thu, 28 Sep 2017 16:16:46 -0400 Received: by mail-pf0-f193.google.com with SMTP id h4so2373926pfk.0; Thu, 28 Sep 2017 13:16:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=S/DGZQ0Z+NVkHlVsFB/CSWU6dpduJqZnlq6HG7JEZ0M=; b=l9pbDajStZkwc/QoGcsQdfM9C8NiSwJZAIRshxAO7nVFloRaawo5UUBaUpRsMUiXFa m1TNu7ZvPXD3P+enXdml7Z22LnFajt0AQj3N8mbGIj/wZrC7U5I0/zfOkl3JZcTLy9Az h+umU7s3jRJENdmGravK5rfyiErm1edbQ85EoTYTYodQqKv+IYgBWCJ+BW9ILgO6jVol CaKax0049Kmx2FneY1yeh2BQG6sWpjM8HX7TLuM1HwXIhaiFFbMWCztKkNcdjtYXvobF xOJ4bYoR7I/2mH+IdI8g034xn9mXQmVGwyUYD06NZ9LhdP2N4mYJO3IoQJx78lTq+dec q4sg== 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; bh=S/DGZQ0Z+NVkHlVsFB/CSWU6dpduJqZnlq6HG7JEZ0M=; b=Sqt+U0xAKWTzakRt+Zd+UGY9jvNaGqWV6llewuF6v1wzK3VknUGi7UyxiPzyLVHzG/ vdVr7FBbFbkLeKdVsJVJrcLmW7KsQ7FfJQ9ukQYkoeVroSsJC74N1ncoTDACrVUirCkh Twz2aH/tU3ucqjhbB0p44mEti73V1GA0lksgsqzHglIjDpMXYNjb0YGZ5ejhFJJqLGts qo2GAzjNLZRQnZSCiRUSYQ9TyCfZysS+Q3ekSABW7cP/dJQ57QsFrrP15KQuPU5evh+z gGjFCYUs1XuyLr+mp86qIcaW1f41fhOyhAuqtM8hp0meugY/BfNuwsDAQFOu2OnuF+6l HfAA== X-Gm-Message-State: AHPjjUgaLjL8LHH3CaicUay6+4uRjwqEUZGfyefo0soFaBoByT8axwUu uk2/cqWowEKmRsvGP9rpOwc= X-Google-Smtp-Source: AOwi7QCPquw4Uo1ldRgEPn4vi1QyFenNKQS1Sm/s1wSpJzbfvsBnT2Zk0EXnjD/EAIeGL3zm8Eb3Qw== X-Received: by 10.159.229.136 with SMTP id az8mr4819365plb.79.1506629806182; Thu, 28 Sep 2017 13:16:46 -0700 (PDT) Received: from localhost.localdomain ([103.254.204.108]) by smtp.gmail.com with ESMTPSA id a18sm3932224pgd.57.2017.09.28.13.16.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Sep 2017 13:16:45 -0700 (PDT) From: Himanshu Jha To: b.zolnierkie@samsung.com Cc: gustavo@embeddedor.com, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, Himanshu Jha Subject: [PATCH] video: fbdev: pxa3xx_gcu: Use setup_timer and mod_timer Date: Fri, 29 Sep 2017 01:46:31 +0530 Message-Id: <1506629791-11695-1-git-send-email-himanshujha199640@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use setup_timer and mod_timer API instead of structure assignments. This is done using Coccinelle and semantic patch used for this as follows: @@ expression x,y,z,a,b; @@ -init_timer (&x); +setup_timer (&x, y, z); +mod_timer (&a, b); -x.function = y; -x.data = z; -x.expires = b; -add_timer(&a); Signed-off-by: Himanshu Jha --- drivers/video/fbdev/pxa3xx-gcu.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/video/fbdev/pxa3xx-gcu.c b/drivers/video/fbdev/pxa3xx-gcu.c index 933619d..3366076 100644 --- a/drivers/video/fbdev/pxa3xx-gcu.c +++ b/drivers/video/fbdev/pxa3xx-gcu.c @@ -520,12 +520,8 @@ static void pxa3xx_gcu_debug_timedout(unsigned long ptr) QERROR("Timer DUMP"); /* init the timer structure */ - init_timer(&pxa3xx_gcu_debug_timer); - pxa3xx_gcu_debug_timer.function = pxa3xx_gcu_debug_timedout; - pxa3xx_gcu_debug_timer.data = ptr; - pxa3xx_gcu_debug_timer.expires = jiffies + 5*HZ; /* one second */ - - add_timer(&pxa3xx_gcu_debug_timer); + setup_timer(&pxa3xx_gcu_debug_timer, pxa3xx_gcu_debug_timedout, ptr); + mod_timer(&pxa3xx_gcu_debug_timer, jiffies + 5 * HZ); } static void pxa3xx_gcu_init_debug_timer(void)