lkml.org 
[lkml]   [2015]   [Mar]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC 07/19] dwc3: core: cleanup suspend/resume code
Hello.

On 3/18/2015 5:04 PM, Robert Baldyga wrote:

> Remove unused cases from switch-case statement and place
> dwc3_event_buffers_cleanup() function outside switch-case
> as it's called in each case anyway.

> Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
> ---
> drivers/usb/dwc3/core.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)

> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index 2bbab3d..b040ce0 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -1018,13 +1018,12 @@ static int dwc3_suspend(struct device *dev)
> case USB_DR_MODE_PERIPHERAL:
> case USB_DR_MODE_OTG:
> dwc3_gadget_suspend(dwc);
> - /* FALLTHROUGH */

Why are you removing comment that stays valid?

> - case USB_DR_MODE_HOST:
> default:
> - dwc3_event_buffers_cleanup(dwc);
> break;
> }
>
> + dwc3_event_buffers_cleanup(dwc);
> +
> dwc->gctl = dwc3_readl(dwc->regs, DWC3_GCTL);
> spin_unlock_irqrestore(&dwc->lock, flags);
>
> @@ -1061,10 +1060,7 @@ static int dwc3_resume(struct device *dev)
> case USB_DR_MODE_PERIPHERAL:
> case USB_DR_MODE_OTG:
> dwc3_gadget_resume(dwc);
> - /* FALLTHROUGH */

Likewise.

> - case USB_DR_MODE_HOST:
> default:
> - /* do nothing */
> break;
> }
>

WBR, Sergei



\
 
 \ /
  Last update: 2015-03-18 16:41    [W:0.209 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site