Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1396501 > unrolled thread
| Started by | Heinrich Schuchardt <xypron.glpk@gmx.de> |
|---|---|
| First post | 2016-05-09 00:10 +0200 |
| Last post | 2016-05-09 10:20 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH 1/1] usb: net2272: avoid shifting 0 Heinrich Schuchardt <xypron.glpk@gmx.de> - 2016-05-09 00:10 +0200
Re: [PATCH 1/1] usb: net2272: avoid shifting 0 Felipe Balbi <balbi@kernel.org> - 2016-05-09 10:20 +0200
| From | Heinrich Schuchardt <xypron.glpk@gmx.de> |
|---|---|
| Date | 2016-05-09 00:10 +0200 |
| Subject | [PATCH 1/1] usb: net2272: avoid shifting 0 |
| Message-ID | <rwF3I-73q-13@gated-at.bofh.it> |
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
[toc] | [next] | [standalone]
| From | Felipe Balbi <balbi@kernel.org> |
|---|---|
| Date | 2016-05-09 10:20 +0200 |
| Message-ID | <rwOA2-1jg-11@gated-at.bofh.it> |
| In reply to | #1396501 |
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
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web