Skip to content

Commit

Permalink
staging/et131x: fix et131x_rx_dma_disable halt_status usage
Browse files Browse the repository at this point in the history
Commit 1bd751c
("Staging: et131x: Clean up rxdma_csr") changed csr from bitfield to
u32, but failed to convert 2 uses of halt_status bit. It did:

- if (csr.bits.halt_status != 1)
+ if ((csr & 0x00020000) != 1)

which is wrong, because second version is always true.
Fix it.

This bug was found by coccinelle (http://coccinelle.lip6.fr/).

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Marcin Slusarz authored and Greg Kroah-Hartman committed Feb 23, 2011
1 parent 3f60554 commit 1af4791
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/et131x/et1310_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -717,10 +717,10 @@ void et131x_rx_dma_disable(struct et131x_adapter *etdev)
/* Setup the receive dma configuration register */
writel(0x00002001, &etdev->regs->rxdma.csr);
csr = readl(&etdev->regs->rxdma.csr);
if ((csr & 0x00020000) != 1) { /* Check halt status (bit 17) */
if ((csr & 0x00020000) == 0) { /* Check halt status (bit 17) */
udelay(5);
csr = readl(&etdev->regs->rxdma.csr);
if ((csr & 0x00020000) != 1)
if ((csr & 0x00020000) == 0)
dev_err(&etdev->pdev->dev,
"RX Dma failed to enter halt state. CSR 0x%08x\n",
csr);
Expand Down

0 comments on commit 1af4791

Please sign in to comment.