* [PATCH] net/niu: remove one superfluous dma mask check
@ 2012-05-03 18:22 Sebastian Andrzej Siewior
2012-05-03 18:55 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Sebastian Andrzej Siewior @ 2012-05-03 18:22 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Sebastian Andrzej Siewior
The idea here seems to be to get a 44bit DMA mask working and if this
fails it should fallback to a 32bit DMA mask. The dma_mask variable is
assigned once to 44bit and never updated. pci_set_dma_mask() and
pci_set_consistent_dma_mask() are both implemented as functions so there
is no evil macro which might update dma_mask. Looking at the assembly, I
see a call to dma_set_mask() followed by dma_supported() and then a jump
passed the second dma_set_mask(). The only way to get to second
dma_set_mask() call is by an error code in the first one.
So I hereby remove the check since it looks superfluous. Please ignore
the path if there is black magic involved.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
drivers/net/ethernet/sun/niu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c
index c99b3b0..703c8cc 100644
--- a/drivers/net/ethernet/sun/niu.c
+++ b/drivers/net/ethernet/sun/niu.c
@@ -9838,7 +9838,7 @@ static int __devinit niu_pci_init_one(struct pci_dev *pdev,
goto err_out_release_parent;
}
}
- if (err || dma_mask == DMA_BIT_MASK(32)) {
+ if (err) {
err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
if (err) {
dev_err(&pdev->dev, "No usable DMA configuration, aborting\n");
--
1.7.10
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net/niu: remove one superfluous dma mask check
2012-05-03 18:22 [PATCH] net/niu: remove one superfluous dma mask check Sebastian Andrzej Siewior
@ 2012-05-03 18:55 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2012-05-03 18:55 UTC (permalink / raw)
To: bigeasy; +Cc: netdev
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Thu, 3 May 2012 20:22:00 +0200
> The idea here seems to be to get a 44bit DMA mask working and if this
> fails it should fallback to a 32bit DMA mask. The dma_mask variable is
> assigned once to 44bit and never updated. pci_set_dma_mask() and
> pci_set_consistent_dma_mask() are both implemented as functions so there
> is no evil macro which might update dma_mask. Looking at the assembly, I
> see a call to dma_set_mask() followed by dma_supported() and then a jump
> passed the second dma_set_mask(). The only way to get to second
> dma_set_mask() call is by an error code in the first one.
>
> So I hereby remove the check since it looks superfluous. Please ignore
> the path if there is black magic involved.
>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
It looks like it's been this way since day one. :-)
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-05-03 18:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-03 18:22 [PATCH] net/niu: remove one superfluous dma mask check Sebastian Andrzej Siewior
2012-05-03 18:55 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).