From patchwork Mon Oct 16 23:10:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 10010093 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 1136160230 for ; Mon, 16 Oct 2017 23:12:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0336C284FC for ; Mon, 16 Oct 2017 23:12:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EC69C28689; Mon, 16 Oct 2017 23:12:20 +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=unavailable 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 723E2284FC for ; Mon, 16 Oct 2017 23:12:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752471AbdJPXKb (ORCPT ); Mon, 16 Oct 2017 19:10:31 -0400 Received: from mail-pf0-f176.google.com ([209.85.192.176]:52939 "EHLO mail-pf0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932762AbdJPXK3 (ORCPT ); Mon, 16 Oct 2017 19:10:29 -0400 Received: by mail-pf0-f176.google.com with SMTP id e64so16894928pfk.9 for ; Mon, 16 Oct 2017 16:10:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=Sd3UOzRLHLkMdClqK99M0TVs5Ke6pFB0JYTYnmG29tQ=; b=HgMgzslU/CA9XxRGlSqGjArmQD18J3dLdodj/0FBHpEJzv4zPW93IvXpu2BvgxNKBM qqVKRQR8SvDHNYz/0kUiojB0ZFt01MccLT84Oms9LG5jeOyQ2GwPJPsRhV0xtjqAJzOB 6/xYDwwMxRFfpg1vBzWp9UBEG09lktmnZxtLE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=Sd3UOzRLHLkMdClqK99M0TVs5Ke6pFB0JYTYnmG29tQ=; b=OXLw28Tkm07D2xSmXyVUEb+k7+o6p26axMDxne0j7zmr8VonPqOvyB51QlWtcErkPn TmdAAA+Qi45isiKaw2QZYvd0lMEi0/3g8MA1ik0HR0aXrY6gHccj64vRF8P+ym61viIw CEK1bdOptqUM7tCyleIXUzuUH6TN9kNfXWjeAcTQViu1TadkQwid/CJqVIlJLjdaOuAw R6xqJGPUK4F4EnKDX/9qDcaiQOtdmddGZEVmqCWSiCcUhxAfLbdvrpCkMOKVEvfRa8Hl RWLsAjLpUox1wkZJK0bG/3Zv9fq0RE6rncqSvJRz8Smhhhme0oXjaeG7VKh8YWwN9aEv 53pQ== X-Gm-Message-State: AMCzsaXAuyXDBsm1RHS5O4YS4PKf4bVe0mOeanhOcwbPPcGOnnzUXMji A+336M3pQn/JkXd0PhdFlZggtQ== X-Google-Smtp-Source: ABhQp+R9dI3eu0FYv0yMUSYRQMWi48Cg0RfQcmZfshOuSSpuof2HbICfl511+wQPxtJjUDElNqeL7g== X-Received: by 10.84.140.131 with SMTP id 3mr3136312plt.67.1508195429044; Mon, 16 Oct 2017 16:10:29 -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 r64sm15962330pfg.25.2017.10.16.16.10.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Oct 2017 16:10:27 -0700 (PDT) Date: Mon, 16 Oct 2017 16:10:27 -0700 From: Kees Cook To: Mauro Carvalho Chehab Cc: Mats Randgaard , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] media: tc358743: Convert timers to use timer_setup() Message-ID: <20171016231027.GA99719@beast> MIME-Version: 1.0 Content-Disposition: inline Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Cc: Mats Randgaard Cc: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org Signed-off-by: Kees Cook --- drivers/media/i2c/tc358743.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/tc358743.c b/drivers/media/i2c/tc358743.c index a9355032076f..359f63d7dfca 100644 --- a/drivers/media/i2c/tc358743.c +++ b/drivers/media/i2c/tc358743.c @@ -1481,9 +1481,9 @@ static irqreturn_t tc358743_irq_handler(int irq, void *dev_id) return handled ? IRQ_HANDLED : IRQ_NONE; } -static void tc358743_irq_poll_timer(unsigned long arg) +static void tc358743_irq_poll_timer(struct timer_list *t) { - struct tc358743_state *state = (struct tc358743_state *)arg; + struct tc358743_state *state = from_timer(state, t, timer); unsigned int msecs; schedule_work(&state->work_i2c_poll); @@ -2147,8 +2147,7 @@ static int tc358743_probe(struct i2c_client *client, } else { INIT_WORK(&state->work_i2c_poll, tc358743_work_i2c_poll); - setup_timer(&state->timer, tc358743_irq_poll_timer, - (unsigned long)state); + timer_setup(&state->timer, tc358743_irq_poll_timer, 0); state->timer.expires = jiffies + msecs_to_jiffies(POLL_INTERVAL_MS); add_timer(&state->timer);