From: Michal Nazarewicz <mina86@mina86.com>
To: Kees Cook <keescook@chromium.org>, Thomas Gleixner <tglx@linutronix.de>
Cc: Kees Cook <keescook@chromium.org>,
Felipe Balbi <balbi@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Raviteja Garimella <raviteja.garimella@broadcom.com>,
"Gustavo A. R. Silva" <garsilva@embeddedor.com>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 27/31] usb/gadget/snps_udc_core: Remove struct timer_list.data use
Date: Thu, 21 Sep 2017 16:06:13 +0200 [thread overview]
Message-ID: <xa1tfubg9mei.fsf@mina86.com> (raw)
In-Reply-To: <1505950075-50223-28-git-send-email-keescook@chromium.org>
On Wed, Sep 20 2017, Kees Cook wrote:
> If the probe fails, udc_remove() will not be called, so there is no
> reason to make del_timer_sync() calls conditional. As a result, use of
> the .data field can be dropped, in support of making removing this field
> entirely from struct timer_list.
>
> Cc: Felipe Balbi <balbi@kernel.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Raviteja Garimella <raviteja.garimella@broadcom.com>
> Cc: Michal Nazarewicz <mina86@mina86.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
> Cc: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
> Cc: linux-usb@vger.kernel.org
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
> drivers/usb/gadget/udc/snps_udc_core.c | 14 ++++----------
> 1 file changed, 4 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/usb/gadget/udc/snps_udc_core.c b/drivers/usb/gadget/udc/snps_udc_core.c
> index 5460e5ba1c3c..e05bdc16e1e3 100644
> --- a/drivers/usb/gadget/udc/snps_udc_core.c
> +++ b/drivers/usb/gadget/udc/snps_udc_core.c
> @@ -3067,14 +3067,12 @@ void udc_remove(struct udc *dev)
> stop_timer++;
> if (timer_pending(&udc_timer))
> wait_for_completion(&on_exit);
> - if (udc_timer.data)
> - del_timer_sync(&udc_timer);
> + del_timer_sync(&udc_timer);
> /* remove pollstall timer */
> stop_pollstall_timer++;
> if (timer_pending(&udc_pollstall_timer))
> wait_for_completion(&on_pollstall_exit);
> - if (udc_pollstall_timer.data)
> - del_timer_sync(&udc_pollstall_timer);
> + del_timer_sync(&udc_pollstall_timer);
> udc = NULL;
> }
> EXPORT_SYMBOL_GPL(udc_remove);
> @@ -3164,10 +3162,6 @@ int udc_probe(struct udc *dev)
> u32 reg;
> int retval;
>
> - /* mark timer as not initialized */
> - udc_timer.data = 0;
> - udc_pollstall_timer.data = 0;
> -
> /* device struct setup */
> dev->gadget.ops = &udc_ops;
>
> @@ -3207,8 +3201,8 @@ int udc_probe(struct udc *dev)
> goto finished;
>
> /* timer init */
> - setup_timer(&udc_timer, udc_timer_function, 1);
> - setup_timer(&udc_pollstall_timer, udc_pollstall_timer_function, 1);
> + setup_timer(&udc_timer, udc_timer_function, 0);
> + setup_timer(&udc_pollstall_timer, udc_pollstall_timer_function, 0);
>
> /* set SD */
> reg = readl(&dev->regs->ctl);
--
Best regards
ミハウ “𝓶𝓲𝓷𝓪86” ナザレヴイツ
«If at first you don’t succeed, give up skydiving»
next prev parent reply other threads:[~2017-09-21 14:06 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-20 23:27 [PATCH v2 00/31] struct timer_list callback argument conversion, step 1 Kees Cook
2017-09-20 23:27 ` [PATCH v2 01/31] coccinelle: Improve setup_timer.cocci matching Kees Cook
2017-09-23 20:43 ` Julia Lawall
2017-11-07 0:18 ` Masahiro Yamada
2017-09-20 23:27 ` [PATCH v2 02/31] timer: Convert open-coded init_timer() to setup_timer() Kees Cook
2017-09-20 23:27 ` [PATCH v2 03/31] timer: Remove init_timer_pinned_deferrable() in favor of setup_pinned_deferrable_timer() Kees Cook
2017-09-26 11:12 ` Gautham R Shenoy
2017-09-20 23:27 ` [PATCH v2 04/31] timer: Remove init_timer_on_stack() in favor of setup_timer_on_stack() Kees Cook
2017-09-20 23:27 ` [PATCH v2 05/31] timer: Remove init_timer_pinned() in favor of setup_pinned_timer() Kees Cook
2017-09-20 23:27 ` [PATCH v2 06/31] timer: Remove init_timer_deferrable() in favor of setup_deferrable_timer() Kees Cook
2017-09-20 23:27 ` [PATCH v2 07/31] timer: Remove users of TIMER_DEFERRED_INITIALIZER Kees Cook
2017-09-20 23:27 ` [PATCH v2 08/31] timer: Remove users of TIMER_INITIALIZER Kees Cook
2017-09-20 23:27 ` [PATCH v2 09/31] timer: Remove unused static initializer macros Kees Cook
2017-09-20 23:27 ` [PATCH v2 10/31] timer: Remove users of expire and data arguments to DEFINE_TIMER Kees Cook
2017-09-20 23:27 ` [PATCH v2 11/31] timer: Remove expires and data arguments from DEFINE_TIMER Kees Cook
2017-09-20 23:27 ` [PATCH v2 12/31] timer: Remove expires argument from __TIMER_INITIALIZER() Kees Cook
2017-09-20 23:27 ` [PATCH v2 13/31] timer: Remove meaningless .data/.function assignments Kees Cook
2017-09-20 23:27 ` [PATCH v2 14/31] timer: Collapse cross-function single-assignment .data into setup_timer() Kees Cook
2017-09-20 23:27 ` [PATCH v2 15/31] timer: Additional init_timer() -> setup_timer() conversions Kees Cook
2017-09-20 23:27 ` [PATCH v2 16/31] usb/phy-isp1301-omap: Remove .data assignment Kees Cook
2017-09-28 9:36 ` Felipe Balbi
2017-09-20 23:27 ` [PATCH v2 17/31] media/i2c/tc358743: Initialize timer Kees Cook
2017-09-20 23:27 ` [PATCH v2 18/31] scsi/aic7xxx: Clean up timer usage Kees Cook
2017-09-21 7:35 ` Hannes Reinecke
2017-09-20 23:27 ` [PATCH v2 19/31] timer: Remove open-coded casts for .data and .function Kees Cook
2017-09-20 23:27 ` [PATCH v2 20/31] net/core: Collapse redundant sk_timer callback data assignments Kees Cook
2017-09-20 23:27 ` [PATCH v2 21/31] s390/char/sclp: Use separate static data field with with static timer Kees Cook
2017-09-20 23:27 ` [PATCH v2 22/31] sparc/led: " Kees Cook
2017-09-20 23:27 ` [PATCH v2 23/31] mips/sgi-ip32: " Kees Cook
2017-09-20 23:27 ` [PATCH v2 24/31] mips/sgi-ip22: " Kees Cook
2017-09-20 23:27 ` [PATCH v2 25/31] net/atm/mpc: " Kees Cook
2017-09-20 23:27 ` [PATCH v2 26/31] staging/comedi/das16: Make timer initialization unconditional Kees Cook
2017-09-21 10:33 ` Ian Abbott
2017-09-20 23:27 ` [PATCH v2 27/31] usb/gadget/snps_udc_core: Remove struct timer_list.data use Kees Cook
2017-09-21 14:06 ` Michal Nazarewicz [this message]
2017-09-28 9:36 ` Felipe Balbi
2017-09-20 23:27 ` [PATCH v2 28/31] infiniband/rdmavt: Remove redundant timer initialization Kees Cook
2017-09-20 23:27 ` [PATCH v2 29/31] scsi/bnx2i: Initialize timer Kees Cook
2017-09-20 23:27 ` [PATCH v2 30/31] appletalk: Remove unneeded synchronization Kees Cook
2017-09-20 23:27 ` [PATCH v2 31/31] timer: Switch to testing for .function instead of .data Kees Cook
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=xa1tfubg9mei.fsf@mina86.com \
--to=mina86@mina86.com \
--cc=balbi@kernel.org \
--cc=garsilva@embeddedor.com \
--cc=gregkh@linuxfoundation.org \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=raviteja.garimella@broadcom.com \
--cc=tglx@linutronix.de \
/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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox