From patchwork Mon Oct 16 23:29:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 10010179 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 A2436601D5 for ; Mon, 16 Oct 2017 23:29:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 938132823E for ; Mon, 16 Oct 2017 23:29:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 876E628408; Mon, 16 Oct 2017 23:29:34 +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 DDCDA2823E for ; Mon, 16 Oct 2017 23:29:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932521AbdJPX3b (ORCPT ); Mon, 16 Oct 2017 19:29:31 -0400 Received: from mail-pf0-f176.google.com ([209.85.192.176]:56180 "EHLO mail-pf0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932629AbdJPX3Z (ORCPT ); Mon, 16 Oct 2017 19:29:25 -0400 Received: by mail-pf0-f176.google.com with SMTP id 17so16916262pfn.12 for ; Mon, 16 Oct 2017 16:29:25 -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=ToVdI/yfGIEX+qtO59OygPMgHwehRDSM1VWaLrNCd8I=; b=ZW0njN+0HNS/KSc3aiQv9HBqiQnvXjJsdcoHMnV4krOdqGSsCVTe8LDeMrpXtVcrq6 XkORKsyhjrP8yXF+6IgqQtpBRRtAeSECCzu3h2zpCDtgMRLNqvlLUf0OFFsuxpHNUa1n D42tSqoOTonndcx2Ks0EH/JVW10TeC+lQ1xN8= 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=ToVdI/yfGIEX+qtO59OygPMgHwehRDSM1VWaLrNCd8I=; b=Eeh8s5Z2AVwSl3gBzVCHlN2tPBizN9edPb1zihTYNrg7805TruAozhg+K7OFtKl5Uu t8iwRn2ZIEDukCUvW/DoDaXEBTDFWArcfDT11gpvRQfZol2umw0LHU4fVEw2cF6oZIz2 GmstiSRyNzfQWYl77XRNhIR37djtlS7iYLupEprl2p0Ox8fMOTBjxJjJIXtDQ1FNrqFb poi3DhKbzFbY2pvPUvBNl6h0d/3qn97m0hZKG/Oxmiszmu6NARSEUOMGX/Jp090DKg+M cTodvvhHMC3kifKPBSeErY1HwHQ0W0ot6Ta2EhkE/f3ea/Y6WtjGfK5d0wbDWP9EQANw byrQ== X-Gm-Message-State: AMCzsaW3ZMafUAvrkbhbeXXbWrvld1KmKlJ2qSMhoMjlKH3ifyjJyYID pT79ry8vStr4zxUoCR9Uqu18Hw== X-Google-Smtp-Source: AOwi7QAacE73UmuYFMMxjzAD8OwzUFaZdaWFZUfjx4hjLQ2R8qgIz7Eu6KS8rQe+g1obbFfbL2pvHg== X-Received: by 10.84.235.75 with SMTP id g11mr10257101plt.155.1508196565076; Mon, 16 Oct 2017 16:29:25 -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 81sm16829902pfh.145.2017.10.16.16.29.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Oct 2017 16:29:23 -0700 (PDT) Date: Mon, 16 Oct 2017 16:29:23 -0700 From: Kees Cook To: Greg Kroah-Hartman Cc: Felipe Balbi , linux-usb@vger.kernel.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] usb: isp1301-omap: Convert timers to use timer_setup() Message-ID: <20171016232923.GA101254@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 Signed-off-by: Kees Cook Acked-by: Tony Lindgren Acked-by: Felipe Balbi --- drivers/usb/phy/phy-isp1301-omap.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/usb/phy/phy-isp1301-omap.c b/drivers/usb/phy/phy-isp1301-omap.c index 8a07ce63b92d..00bcc6c6db17 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); } /*-------------------------------------------------------------------------*/ @@ -1506,7 +1508,7 @@ isp1301_probe(struct i2c_client *i2c, const struct i2c_device_id *id) } INIT_WORK(&isp->work, isp1301_work); - setup_timer(&isp->timer, isp1301_timer, (unsigned long)isp); + timer_setup(&isp->timer, isp1301_timer, 0); i2c_set_clientdata(i2c, isp); isp->client = i2c;