Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1671084 > unrolled thread

[PATCH] usb: musb: compress return logic into one line

Started by"Gustavo A. R. Silva" <garsilva@embeddedor.com>
First post2017-06-20 22:30 +0200
Last post2017-06-21 16:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] usb: musb: compress return logic into one line "Gustavo A. R. Silva" <garsilva@embeddedor.com> - 2017-06-20 22:30 +0200
    Re: [PATCH] usb: musb: compress return logic into one line Bin Liu <b-liu@ti.com> - 2017-06-21 16:30 +0200

#1671084 — [PATCH] usb: musb: compress return logic into one line

From"Gustavo A. R. Silva" <garsilva@embeddedor.com>
Date2017-06-20 22:30 +0200
Subject[PATCH] usb: musb: compress return logic into one line
Message-ID<tUxWH-4Sn-23@gated-at.bofh.it>
Simplify return logic to avoid unnecessary variable assignment.

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/usb/musb/musb_host.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
index dbe617a..76decb8 100644
--- a/drivers/usb/musb/musb_host.c
+++ b/drivers/usb/musb/musb_host.c
@@ -1540,7 +1540,7 @@ static int musb_rx_dma_iso_cppi41(struct dma_controller *dma,
 	struct dma_channel *channel = hw_ep->rx_channel;
 	void __iomem *epio = hw_ep->regs;
 	dma_addr_t *buf;
-	u32 length, res;
+	u32 length;
 	u16 val;
 
 	buf = (void *)urb->iso_frame_desc[qh->iso_idx].offset +
@@ -1552,10 +1552,8 @@ static int musb_rx_dma_iso_cppi41(struct dma_controller *dma,
 	val |= MUSB_RXCSR_DMAENAB;
 	musb_writew(hw_ep->regs, MUSB_RXCSR, val);
 
-	res = dma->channel_program(channel, qh->maxpacket, 0,
+	return dma->channel_program(channel, qh->maxpacket, 0,
 				   (u32)buf, length);
-
-	return res;
 }
 #else
 static inline int musb_rx_dma_iso_cppi41(struct dma_controller *dma,
-- 
2.5.0

[toc] | [next] | [standalone]


#1671704

FromBin Liu <b-liu@ti.com>
Date2017-06-21 16:30 +0200
Message-ID<tUONP-7dN-7@gated-at.bofh.it>
In reply to#1671084
Hi Greg,

On Tue, Jun 20, 2017 at 03:24:27PM -0500, Gustavo A. R. Silva wrote:
> Simplify return logic to avoid unnecessary variable assignment.
> 
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>

My tree is already closed for v4.13. if you want to pick it up directly,
here is my Acked-by, or I will take it for v4.14.

Acked-by: Bin Liu <b-liu@ti.com>

Regards,
-Bin.

> ---
>  drivers/usb/musb/musb_host.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
> index dbe617a..76decb8 100644
> --- a/drivers/usb/musb/musb_host.c
> +++ b/drivers/usb/musb/musb_host.c
> @@ -1540,7 +1540,7 @@ static int musb_rx_dma_iso_cppi41(struct dma_controller *dma,
>  	struct dma_channel *channel = hw_ep->rx_channel;
>  	void __iomem *epio = hw_ep->regs;
>  	dma_addr_t *buf;
> -	u32 length, res;
> +	u32 length;
>  	u16 val;
>  
>  	buf = (void *)urb->iso_frame_desc[qh->iso_idx].offset +
> @@ -1552,10 +1552,8 @@ static int musb_rx_dma_iso_cppi41(struct dma_controller *dma,
>  	val |= MUSB_RXCSR_DMAENAB;
>  	musb_writew(hw_ep->regs, MUSB_RXCSR, val);
>  
> -	res = dma->channel_program(channel, qh->maxpacket, 0,
> +	return dma->channel_program(channel, qh->maxpacket, 0,
>  				   (u32)buf, length);
> -
> -	return res;
>  }
>  #else
>  static inline int musb_rx_dma_iso_cppi41(struct dma_controller *dma,
> -- 
> 2.5.0
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web