Skip to contentSkip to conversation

usb: musb: compress return logic into one line

PATCH In review Gustavo A. R. Silva 2 participants 2 messages Jun 20, 2017 – Jun 21, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: musb: compress return logic into one line

Simplify return logic to avoid unnecessary variable assignment.

---
 drivers/usb/musb/musb_host.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/usb/musb/musb_host.c +2 -4
index dbe617a..76decb8 100644
@@ -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,
Signature · 1 line
2.5.0
maintainer Acked-by on v1 1/1
#1 lore raw

Hi Greg,

Quoted 3 lines · Gustavo A. R. Silva

Simplify return logic to avoid unnecessary variable assignment.

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.

Regards,
-Bin.

Quoted 32 lines
---
 drivers/usb/musb/musb_host.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/usb/musb/musb_host.c +2 -4
index dbe617a..76decb8 100644
@@ -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,
Signature · 1 line
2.5.0