From patchwork Tue Oct 24 15:23:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 10024879 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 6DAA960375 for ; Tue, 24 Oct 2017 15:24:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F48D20072 for ; Tue, 24 Oct 2017 15:24:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 545A320416; Tue, 24 Oct 2017 15:24:40 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM 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 DA94220072 for ; Tue, 24 Oct 2017 15:24:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751817AbdJXPXy (ORCPT ); Tue, 24 Oct 2017 11:23:54 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:44112 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932413AbdJXPXY (ORCPT ); Tue, 24 Oct 2017 11:23:24 -0400 Received: by mail-pf0-f195.google.com with SMTP id x7so19933011pfa.1 for ; Tue, 24 Oct 2017 08:23:24 -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=zeZ+1n/A5DY90n00B9o7Gjpp+sBv7QmlC+WRDc1spLM=; b=CjJ+HTn+l7Xc4+Cq3HFrI7A8cqHqM3gXjNj4sO34IqsZTnAZhBaNTmChvc/iTbYnAC 7q63mLMTTuTHmccqN51pdYQDOVwjhad9Pdl3ihbKdE/FQ3uuQvMzcZldpmxPYHE2ZjXw dx0MmAF6smORxoHJ1ewCXpWZlFcDxv1mFMBug= 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=zeZ+1n/A5DY90n00B9o7Gjpp+sBv7QmlC+WRDc1spLM=; b=bmrA95mh+hkCUy4447efImXfuzV81uMubJQuY1VWWHrjubgUSU99E22t/cnNfXnXBr CAFeLQBVZObR6g66G/ZyzlTcSv5fPEvNzoFpJJsX1yeq3URAmMIiMBWhQQNI7u5A9Gxf yE44KVknV0gUgKzAgfrNHrLlr3HgF1g8rl+8x5ehY0k4HWpVMrbPKghJ3rI8ZkAbLShb ZuJj9HCHVIMLwXiuOxEurl7pTyKNynOrMt97XpseEEPwtD6dyIQIOtxLbcz2DG/G45IE AydY8ndXz4KTfnuhagriIwlp6uh/quA9c4LQLbchuLQLSB6OnwQgLwPlr4SBKN82wXy7 g0WA== X-Gm-Message-State: AMCzsaWqrMAA5ABewxf5s+lmHvwMIeFLhAMNCJlzFjZhF8EOW6EnfXK5 LeBX4t+AUj21RZUX9ztDF82zug== X-Google-Smtp-Source: ABhQp+QKEJlf1DuNf8FQrGItt9w94V6Q+yKgTZVaT6h1m/ADmo9IMIzwnf1mBor7jlJenlDXZCNOjg== X-Received: by 10.98.155.10 with SMTP id r10mr16733125pfd.66.1508858603749; Tue, 24 Oct 2017 08:23:23 -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 q13sm821557pgt.87.2017.10.24.08.23.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Oct 2017 08:23:22 -0700 (PDT) Date: Tue, 24 Oct 2017 08:23:21 -0700 From: Kees Cook To: Mauro Carvalho Chehab Cc: Laurent Pinchart , Sakari Ailus , Bhumika Goyal , Mike Isely , Arvind Yadav , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] media: s2255: Convert timers to use timer_setup() Message-ID: <20171024152321.GA105022@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: Mauro Carvalho Chehab Cc: Laurent Pinchart Cc: Sakari Ailus Cc: Bhumika Goyal Cc: Mike Isely Cc: Arvind Yadav Cc: linux-media@vger.kernel.org Signed-off-by: Kees Cook --- drivers/media/usb/s2255/s2255drv.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/media/usb/s2255/s2255drv.c b/drivers/media/usb/s2255/s2255drv.c index b2f239c4ba42..7fee5766587a 100644 --- a/drivers/media/usb/s2255/s2255drv.c +++ b/drivers/media/usb/s2255/s2255drv.c @@ -485,9 +485,10 @@ static void s2255_reset_dsppower(struct s2255_dev *dev) /* kickstarts the firmware loading. from probe */ -static void s2255_timer(unsigned long user_data) +static void s2255_timer(struct timer_list *t) { - struct s2255_fw *data = (struct s2255_fw *)user_data; + struct s2255_dev *dev = from_timer(dev, t, timer); + struct s2255_fw *data = dev->fw_data; if (usb_submit_urb(data->fw_urb, GFP_ATOMIC) < 0) { pr_err("s2255: can't submit urb\n"); atomic_set(&data->fw_state, S2255_FW_FAILED); @@ -2283,7 +2284,7 @@ static int s2255_probe(struct usb_interface *interface, dev_err(&interface->dev, "Could not find bulk-in endpoint\n"); goto errorEP; } - setup_timer(&dev->timer, s2255_timer, (unsigned long)dev->fw_data); + timer_setup(&dev->timer, s2255_timer, 0); init_waitqueue_head(&dev->fw_data->wait_fw); for (i = 0; i < MAX_CHANNELS; i++) { struct s2255_vc *vc = &dev->vc[i];