All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] usb: net2272: avoid shifting 0
@ 2016-05-08 22:02 Heinrich Schuchardt
  2016-05-09  8:09 ` Felipe Balbi
  0 siblings, 1 reply; 2+ messages in thread
From: Heinrich Schuchardt @ 2016-05-08 22:02 UTC (permalink / raw)
  To: Felipe Balbi
  Cc: Greg Kroah-Hartman, Andrzej Pietrasiewicz, John Youn,
	Nicholas Bellinger, Robert Baldyga, linux-usb, linux-kernel,
	Heinrich Schuchardt

Remove redundant code.
Or'ing with a shifted value of zero is a NOP.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 drivers/usb/gadget/udc/net2272.c | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/drivers/usb/gadget/udc/net2272.c b/drivers/usb/gadget/udc/net2272.c
index 18f5ebd..777eeba 100644
--- a/drivers/usb/gadget/udc/net2272.c
+++ b/drivers/usb/gadget/udc/net2272.c
@@ -664,7 +664,6 @@ net2272_request_dma(struct net2272 *dev, unsigned ep, u32 buf,
 		/* Setup PLX 9054 DMA mode */
 		writel((1 << LOCAL_BUS_WIDTH) |
 			(1 << TA_READY_INPUT_ENABLE) |
-			(0 << LOCAL_BURST_ENABLE) |
 			(1 << DONE_INTERRUPT_ENABLE) |
 			(1 << LOCAL_ADDRESSING_MODE) |
 			(1 << DEMAND_MODE) |
@@ -688,7 +687,6 @@ net2272_request_dma(struct net2272 *dev, unsigned ep, u32 buf,
 #endif
 
 	net2272_write(dev, DMAREQ,
-		(0 << DMA_BUFFER_VALID) |
 		(1 << DMA_REQUEST_ENABLE) |
 		(1 << DMA_CONTROL_DACK) |
 		(dev->dma_eot_polarity << EOT_POLARITY) |
@@ -779,8 +777,6 @@ net2272_kick_dma(struct net2272_ep *ep, struct net2272_request *req)
 
 			/* deassert dreq */
 			net2272_write(ep->dev, DMAREQ,
-				(0 << DMA_BUFFER_VALID) |
-				(0 << DMA_REQUEST_ENABLE) |
 				(1 << DMA_CONTROL_DACK) |
 				(ep->dev->dma_eot_polarity << EOT_POLARITY) |
 				(ep->dev->dma_dack_polarity << DACK_POLARITY) |
@@ -1363,8 +1359,6 @@ net2272_usb_reset(struct net2272 *dev)
 	net2272_write(dev, IRQSTAT1, ~(1 << SUSPEND_REQUEST_INTERRUPT));
 
 	net2272_write(dev, DMAREQ,
-		(0 << DMA_BUFFER_VALID) |
-		(0 << DMA_REQUEST_ENABLE) |
 		(1 << DMA_CONTROL_DACK) |
 		(dev->dma_eot_polarity << EOT_POLARITY) |
 		(dev->dma_dack_polarity << DACK_POLARITY) |
@@ -1542,9 +1536,7 @@ net2272_handle_dma(struct net2272_ep *ep)
 
 	/* Ensure DREQ is de-asserted */
 	net2272_write(ep->dev, DMAREQ,
-		(0 << DMA_BUFFER_VALID)
-	      | (0 << DMA_REQUEST_ENABLE)
-	      | (1 << DMA_CONTROL_DACK)
+		(1 << DMA_CONTROL_DACK)
 	      | (ep->dev->dma_eot_polarity << EOT_POLARITY)
 	      | (ep->dev->dma_dack_polarity << DACK_POLARITY)
 	      | (ep->dev->dma_dreq_polarity << DREQ_POLARITY)
@@ -2087,7 +2079,7 @@ static irqreturn_t net2272_irq(int irq, void *_dev)
 			dev->rdk1.plx9054_base_addr + INTCSR);
 	}
 	if ((intcsr & DMA_CHANNEL_0_TEST) == DMA_CHANNEL_0_TEST) {
-		writeb((1 << CHANNEL_CLEAR_INTERRUPT | (0 << CHANNEL_ENABLE)),
+		writeb(1 << CHANNEL_CLEAR_INTERRUPT,
 				dev->rdk1.plx9054_base_addr + DMACSR0);
 
 		dmareq = net2272_read(dev, DMAREQ);
@@ -2369,7 +2361,7 @@ net2272_rdk1_probe(struct pci_dev *pdev, struct net2272 *dev)
 			(1 << LOCAL_INTERRUPT_INPUT_ENABLE),
 			dev->rdk1.plx9054_base_addr + INTCSR);
 
-	writeb((1 << CHANNEL_CLEAR_INTERRUPT | (0 << CHANNEL_ENABLE)),
+	writeb(1 << CHANNEL_CLEAR_INTERRUPT,
 			dev->rdk1.plx9054_base_addr + DMACSR0);
 
 	/* reset */
@@ -2377,7 +2369,6 @@ net2272_rdk1_probe(struct pci_dev *pdev, struct net2272 *dev)
 		(1 << DMA_CTL_DACK) |
 		(1 << DMA_TIMEOUT_ENABLE) |
 		(1 << USER) |
-		(0 << MPX_MODE) |
 		(1 << BUSWIDTH) |
 		(1 << NET2272_RESET),
 		dev->base_addr + EPLD_IO_CONTROL_REGISTER);
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] usb: net2272: avoid shifting 0
  2016-05-08 22:02 [PATCH 1/1] usb: net2272: avoid shifting 0 Heinrich Schuchardt
@ 2016-05-09  8:09 ` Felipe Balbi
  0 siblings, 0 replies; 2+ messages in thread
From: Felipe Balbi @ 2016-05-09  8:09 UTC (permalink / raw)
  To: Heinrich Schuchardt
  Cc: Greg Kroah-Hartman, Andrzej Pietrasiewicz, John Youn,
	Nicholas Bellinger, Robert Baldyga, linux-usb, linux-kernel,
	Heinrich Schuchardt, Alan Stern


Heinrich Schuchardt <xypron.glpk@gmx.de> writes:
> Remove redundant code.
> Or'ing with a shifted value of zero is a NOP.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

it sure is and the compiler is getting rid of those. They are there as
means of documentation only ;-)

I really have no strong feelings about this patch, so I'll let the other
folks who have been hacking on this to decide.

-- 
balbi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-09  8:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-08 22:02 [PATCH 1/1] usb: net2272: avoid shifting 0 Heinrich Schuchardt
2016-05-09  8:09 ` Felipe Balbi

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.