From: Kees Cook <keescook@chromium.org> To: Douglas Anderson <dianders@chromium.org> Cc: Felipe Balbi <balbi@kernel.org>, johnyoun@synopsys.com, Stefan Wahren <stefan.wahren@i2se.com>, amstan@chromium.org, linux-rockchip@lists.infradead.org, Johan Hovold <johan@kernel.org>, Greg KH <gregkh@linuxfoundation.org>, Eric Anholt <eric@anholt.net>, Matthias Kaehlcke <mka@chromium.org>, John Stultz <john.stultz@linaro.org>, linux-rpi-kernel@lists.infradead.org, jwerner@chromium.org, linux-usb@vger.kernel.org, LKML <linux-kernel@vger.kernel.org> Subject: Re: [PATCH v3 2/2] usb: dwc2: host: Convert hcd_queue to timer_setup Date: Mon, 30 Oct 2017 14:25:06 -0700 [thread overview] Message-ID: <CAGXu5jK08M=LXuMo2rRzxHwYOokC0ua2pXCHnxR4DOW5Wb73BA@mail.gmail.com> (raw) In-Reply-To: <20171030170802.14489-2-dianders@chromium.org> On Mon, Oct 30, 2017 at 10:08 AM, Douglas Anderson <dianders@chromium.org> wrote: > 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 <stefan.wahren@i2se.com> > Signed-off-by: Douglas Anderson <dianders@chromium.org> > Cc: Kees Cook <keescook@chromium.org> Acked-by: Kees Cook <keescook@chromium.org> This matches my automated Coccinelle output for this code. (Actually, it's better because it fixes the documentation too.) Please feel free to take the patch into -next in advance of the global replacement. Thanks! -Kees > --- > > 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; > > -- > 2.15.0.rc2.357.g7e34df9404-goog > -- Kees Cook Pixel Security
WARNING: multiple messages have this Message-ID (diff)
From: Kees Cook <keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> To: Douglas Anderson <dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> Cc: Felipe Balbi <balbi-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>, johnyoun-HKixBCOQz3hWk0Htik3J/w@public.gmane.org, Stefan Wahren <stefan.wahren-eS4NqCHxEME@public.gmane.org>, amstan-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org, linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Johan Hovold <johan-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>, Greg KH <gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>, Eric Anholt <eric-WhKQ6XTQaPysTnJN9+BGXg@public.gmane.org>, Matthias Kaehlcke <mka-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>, John Stultz <john.stultz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>, linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, jwerner-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org, linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, LKML <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> Subject: Re: [PATCH v3 2/2] usb: dwc2: host: Convert hcd_queue to timer_setup Date: Mon, 30 Oct 2017 14:25:06 -0700 [thread overview] Message-ID: <CAGXu5jK08M=LXuMo2rRzxHwYOokC0ua2pXCHnxR4DOW5Wb73BA@mail.gmail.com> (raw) In-Reply-To: <20171030170802.14489-2-dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> On Mon, Oct 30, 2017 at 10:08 AM, Douglas Anderson <dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> wrote: > 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 <stefan.wahren-eS4NqCHxEME@public.gmane.org> > Signed-off-by: Douglas Anderson <dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> > Cc: Kees Cook <keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> Acked-by: Kees Cook <keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> This matches my automated Coccinelle output for this code. (Actually, it's better because it fixes the documentation too.) Please feel free to take the patch into -next in advance of the global replacement. Thanks! -Kees > --- > > 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; > > -- > 2.15.0.rc2.357.g7e34df9404-goog > -- Kees Cook Pixel Security -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-10-30 21:25 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2017-10-30 17:08 [PATCH v3 1/2] usb: dwc2: host: Don't retry NAKed transactions right away Douglas Anderson 2017-10-30 17:08 ` [PATCH v3 2/2] usb: dwc2: host: Convert hcd_queue to timer_setup Douglas Anderson 2017-10-30 21:25 ` Kees Cook [this message] 2017-10-30 21:25 ` Kees Cook 2017-12-05 16:18 ` [PATCH v3 1/2] usb: dwc2: host: Don't retry NAKed transactions right away Stefan Wahren 2017-12-06 6:06 ` John Youn 2017-12-06 6:06 ` John Youn 2017-12-06 6:06 ` John Youn 2017-12-12 11:06 ` Felipe Balbi 2017-12-12 11:06 ` Felipe Balbi 2017-12-12 18:31 ` Doug Anderson
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to='CAGXu5jK08M=LXuMo2rRzxHwYOokC0ua2pXCHnxR4DOW5Wb73BA@mail.gmail.com' \ --to=keescook@chromium.org \ --cc=amstan@chromium.org \ --cc=balbi@kernel.org \ --cc=dianders@chromium.org \ --cc=eric@anholt.net \ --cc=gregkh@linuxfoundation.org \ --cc=johan@kernel.org \ --cc=john.stultz@linaro.org \ --cc=johnyoun@synopsys.com \ --cc=jwerner@chromium.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-rockchip@lists.infradead.org \ --cc=linux-rpi-kernel@lists.infradead.org \ --cc=linux-usb@vger.kernel.org \ --cc=mka@chromium.org \ --cc=stefan.wahren@i2se.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.