From patchwork Thu Oct 5 00:53:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 9986207 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 E168D60291 for ; Thu, 5 Oct 2017 00:56:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CDD9C28C43 for ; Thu, 5 Oct 2017 00:56:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C282D28C45; Thu, 5 Oct 2017 00:56:31 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham 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 5508828C43 for ; Thu, 5 Oct 2017 00:56:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752673AbdJEAyE (ORCPT ); Wed, 4 Oct 2017 20:54:04 -0400 Received: from mail-pg0-f54.google.com ([74.125.83.54]:53346 "EHLO mail-pg0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753125AbdJEAyB (ORCPT ); Wed, 4 Oct 2017 20:54:01 -0400 Received: by mail-pg0-f54.google.com with SMTP id y192so73169pgd.10 for ; Wed, 04 Oct 2017 17:54:01 -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=y2FViF62GHGYFABpc0069F6qz8RKBrFj7ygAHBJxs/s=; b=CNUI7+Wt4+9b1FTBGEqsSLMig7ftQFAmO7zNlqnVfQKyzv4R4HTvMrsxbMqfL6yt/Q S/lwaiDh88MEXEMNP/qUgD6HZtvm0bKShm7U/fpj3KWrRvVojAHkt7QUHwABZrEsDFlm /ald0skeiVILgjSFlUiCGGlm37PijE9Q1NLWQ= 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=y2FViF62GHGYFABpc0069F6qz8RKBrFj7ygAHBJxs/s=; b=MMLF0D0QUQlTN82M9dpjDeyQW8/lwUiaL1CI5FjHUmcwB8tQnzTl7m6CUX3YR1zeYU VqQ79mOPuZkDryAEOYexvcNbAOya3qkXVprrZTIcM31RRVSuDB9uf7qmQnAxWaSi8ZPy ZKj6/OUv20Yy07uNfrjPuRqYJPVLk4nfImErD3PFIqGizBrz9l8zj610UnVpitKgGSuI 9BnR3NQad6GLoYU5CcDcRII8DzSe9tVPx1fYGoUgpRC9TJlyef4HVFAqumAX42vRJpGG cmBShDJzZIO5eL7i+12CkwCTl8805Jfl9wvmJfxx2jt/MfB+1IRtcmODzBP3UqHNXE/w k4fw== X-Gm-Message-State: AHPjjUg3kCwaNpMHLzGYvtcx1jgoQKlvD61CJFfjUsEMt3gWmVDSOVa/ NkOmhIolp81d8NM+L1JutyHy2w== X-Google-Smtp-Source: AOwi7QDbhgedWjNMQO9t/LKpzMmUPP7vXYhus7TCj287SXqdKuFQnCC2bBIagla9zG5YYQC6fD3yzg== X-Received: by 10.159.211.9 with SMTP id bc9mr21791902plb.192.1507164841050; Wed, 04 Oct 2017 17:54:01 -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 f74sm26992181pfa.36.2017.10.04.17.53.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Oct 2017 17:53:59 -0700 (PDT) Date: Wed, 4 Oct 2017 17:53:59 -0700 From: Kees Cook To: linux-kernel@vger.kernel.org Cc: Felipe Balbi , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-omap@vger.kernel.org, Thomas Gleixner Subject: [PATCH] usb: isp1301-omap: Convert timers to use timer_setup() Message-ID: <20171005005359.GA23866@beast> MIME-Version: 1.0 Content-Disposition: inline Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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: Felipe Balbi Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Cc: linux-omap@vger.kernel.org Cc: Thomas Gleixner Signed-off-by: Kees Cook Acked-by: Tony Lindgren --- This requires commit 686fef928bba ("timer: Prepare to change timer callback argument type") in v4.14-rc3, but should be otherwise stand-alone. --- drivers/usb/phy/phy-isp1301-omap.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/usb/phy/phy-isp1301-omap.c b/drivers/usb/phy/phy-isp1301-omap.c index c6052c814bcc..43866e0f9217 100644 --- a/drivers/usb/phy/phy-isp1301-omap.c +++ b/drivers/usb/phy/phy-isp1301-omap.c @@ -1183,9 +1183,11 @@ static irqreturn_t isp1301_irq(int irq, void *isp) return IRQ_HANDLED; } -static void isp1301_timer(unsigned long _isp) +static void isp1301_timer(struct timer_list *t) { - isp1301_defer_work((void *)_isp, WORK_TIMER); + struct isp1301 *isp = from_timer(isp, t, timer); + + isp1301_defer_work(isp, WORK_TIMER); } /*-------------------------------------------------------------------------*/ @@ -1507,9 +1509,7 @@ isp1301_probe(struct i2c_client *i2c, const struct i2c_device_id *id) } INIT_WORK(&isp->work, isp1301_work); - init_timer(&isp->timer); - isp->timer.function = isp1301_timer; - isp->timer.data = (unsigned long) isp; + timer_setup(&isp->timer, isp1301_timer, 0); i2c_set_clientdata(i2c, isp); isp->client = i2c;