From patchwork Mon Oct 30 17:08:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 10032937 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 60334603B4 for ; Mon, 30 Oct 2017 17:09:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4877D28932 for ; Mon, 30 Oct 2017 17:09:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3D1FC28936; Mon, 30 Oct 2017 17:09:01 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BF4FC28932 for ; Mon, 30 Oct 2017 17:09:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=YeSVkLzXkFiIl9TxrMsrXrZNVF5s3p8QYahx2GjMhxc=; b=tnEb5A67PMvHTcxlSKgyL5nmrW m8e1ulitWIdyYY4+rcYMNjc+wtDKXHTMlT0btwXA3iAhrRNdj/itxf9EkknFgU/HMrjE5giu3bCI8 xxqs01U9mq8yfnIVD23Gseq0m/zqKZKbyrfh0uxJ96NdOCXr4wT3JPN929iAzCwP5/5GrJ4MPU8hU P7EHzcwS3lg2+MxfkNi98vCBA6y0/pvpbP+VOIpc7n/SxHTY8jNFezModJDLDToFr9TYt5SwYbTf6 7Knowqx4QSVnxl9GjIAky2Nvs4Cr1cpdTlpIMcwhGgu+NdeHXi3Tx56TGlB/kE2fpJ/g1hmKoAQl5 8VdzjkhA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e9DYZ-0005J9-5D; Mon, 30 Oct 2017 17:08:59 +0000 Received: from mail-io0-x244.google.com ([2607:f8b0:4001:c06::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e9DYU-0004uC-SM for linux-rockchip@lists.infradead.org; Mon, 30 Oct 2017 17:08:57 +0000 Received: by mail-io0-x244.google.com with SMTP id j17so28775779iod.5 for ; Mon, 30 Oct 2017 10:08:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=B+g4D6nyWDcWlYcd9FoxFokf1Mp9KSkp06ErdRs0ve8=; b=dZ3J30KtHRjAzkM+4iRFgkwKad6d+37xQGiPXJjVsZcMRt7ZxCpyEb06Uc3VnvLB4R cTx8clAkPKmmv6YdiWEmFEZUomksHSWsiW2BG21LIKjb51X7Z1RGiin6GjpQDOTOeRGi kPeqDZQl+U8qQlcqesIsaAQZEn2hadkc/Bmbo= 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:in-reply-to :references; bh=B+g4D6nyWDcWlYcd9FoxFokf1Mp9KSkp06ErdRs0ve8=; b=pn+S1xJTThEOEVp6b4F5mRfDKI++R31125AlB2HVh8y499LgtaUsYp76aD/lEcq5TZ aaboQNJbdo1VHPOxGwj5Y8NH11oEQHQ1qzAeP/plxdKTUx+b0s4Y6AOS8p7aKp2DlWIA UwaY3Ll/tJoAZ6BPfhXmdVjB6FwdboclL+qhZFR2Ij83HC7uwPtNzkgg+hZI/lEfG0f/ cUizMxYekx7IeBE5S7fXYE8zEBLljBTDGrHtgYW4Mp5EKPUwDO5yomBWp7CBFyd3MrM1 umiqZtvKf5KhkM6xKrLjvNEe9AY2lSGLupIL0XtxokcTUlezlxmF0RG2CMR1tgZVSzl4 tjaQ== X-Gm-Message-State: AMCzsaUL2Lh5mrQtg4YUNygRJY5JBzDU9ddAcvuIaKpknY9pHlerZGdW cMXkyhx4e8PR1a37PPQqtaFNvw== X-Google-Smtp-Source: ABhQp+Tqx8Kf7uJ92/zo/XopcJT0Na1xtMYinUkPheBhK1pT2WnXbnhvC4mI067iv6X+Om7vgXD4Cg== X-Received: by 10.36.205.198 with SMTP id l189mr6722139itg.125.1509383315096; Mon, 30 Oct 2017 10:08:35 -0700 (PDT) Received: from tictac.mtv.corp.google.com ([172.22.112.154]) by smtp.gmail.com with ESMTPSA id y73sm2071941itc.8.2017.10.30.10.08.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 30 Oct 2017 10:08:34 -0700 (PDT) From: Douglas Anderson To: balbi@kernel.org, johnyoun@synopsys.com Subject: [PATCH v3 2/2] usb: dwc2: host: Convert hcd_queue to timer_setup Date: Mon, 30 Oct 2017 10:08:01 -0700 Message-Id: <20171030170802.14489-2-dianders@chromium.org> X-Mailer: git-send-email 2.15.0.rc2.357.g7e34df9404-goog In-Reply-To: <20171030170802.14489-1-dianders@chromium.org> References: <20171030170802.14489-1-dianders@chromium.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171030_100855_121522_8AD263FE X-CRM114-Status: GOOD ( 10.03 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: stefan.wahren@i2se.com, amstan@chromium.org, eric@anholt.net, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, johan@kernel.org, Douglas Anderson , linux-rockchip@lists.infradead.org, mka@chromium.org, john.stultz@linaro.org, linux-rpi-kernel@lists.infradead.org, jwerner@chromium.org, linux-kernel@vger.kernel.org, Kees Cook MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Convert the timers in hcd_queue to use the new timer_setup() call introduced in commit 686fef928bba ("timer: Prepare to change timer callback argument type"). Suggested-by: Stefan Wahren Signed-off-by: Douglas Anderson Cc: Kees Cook Acked-by: Kees Cook --- Changes in v3: - Convert hcd_queue to timer_setup new for v3 drivers/usb/dwc2/hcd_queue.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/usb/dwc2/hcd_queue.c b/drivers/usb/dwc2/hcd_queue.c index bea0aadd756e..6f5b5c8b0467 100644 --- a/drivers/usb/dwc2/hcd_queue.c +++ b/drivers/usb/dwc2/hcd_queue.c @@ -1275,11 +1275,11 @@ static void dwc2_do_unreserve(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh) * release the reservation. This worker is called after the appropriate * delay. * - * @work: Pointer to a qh unreserve_work. + * @t: Pointer to unreserve_timer in a qh. */ -static void dwc2_unreserve_timer_fn(unsigned long data) +static void dwc2_unreserve_timer_fn(struct timer_list *t) { - struct dwc2_qh *qh = (struct dwc2_qh *)data; + struct dwc2_qh *qh = from_timer(qh, t, unreserve_timer); struct dwc2_hsotg *hsotg = qh->hsotg; unsigned long flags; @@ -1461,11 +1461,11 @@ static void dwc2_deschedule_periodic(struct dwc2_hsotg *hsotg, * to retry some time later. This function handles that timer and moves the * qh back to the "inactive" list, then queues transactions. * - * @data: Pointer to a qh to re-schedule. + * @t: Pointer to wait_timer in a qh. */ -static void dwc2_wait_timer_fn(unsigned long data) +static void dwc2_wait_timer_fn(struct timer_list *t) { - struct dwc2_qh *qh = (struct dwc2_qh *)data; + struct dwc2_qh *qh = from_timer(qh, t, wait_timer); struct dwc2_hsotg *hsotg = qh->hsotg; unsigned long flags; @@ -1518,9 +1518,8 @@ static void dwc2_qh_init(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh, /* Initialize QH */ qh->hsotg = hsotg; - setup_timer(&qh->unreserve_timer, dwc2_unreserve_timer_fn, - (unsigned long)qh); - setup_timer(&qh->wait_timer, dwc2_wait_timer_fn, (unsigned long)qh); + timer_setup(&qh->unreserve_timer, dwc2_unreserve_timer_fn, 0); + timer_setup(&qh->wait_timer, dwc2_wait_timer_fn, 0); qh->ep_type = ep_type; qh->ep_is_in = ep_is_in;