Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dmaengine: ti: k3-udma-glue: clean up k3_udma_glue_tx_get_irq() return

The k3_udma_glue_tx_get_irq() function currently returns negative error
codes on error, zero on error and positive values for success. This
complicates life for the callers who need to propagate the error code.
Also GCC will not warn about unsigned comparisons when you check:

if (unsigned_irq <= 0)

All the callers have been fixed now but let's just make this easy going
forward.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Roger Quadros <rogerq@kernel.org>
Acked-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Dan Carpenter and committed by
David S. Miller
f9a1d321 a325f174

+6 -5
+3
drivers/dma/ti/k3-udma-glue.c
··· 558 558 tx_chn->virq = k3_ringacc_get_ring_irq_num(tx_chn->ringtxcq); 559 559 } 560 560 561 + if (!tx_chn->virq) 562 + return -ENXIO; 563 + 561 564 return tx_chn->virq; 562 565 } 563 566 EXPORT_SYMBOL_GPL(k3_udma_glue_tx_get_irq);
+2 -2
drivers/net/ethernet/ti/am65-cpsw-nuss.c
··· 1747 1747 } 1748 1748 1749 1749 tx_chn->irq = k3_udma_glue_tx_get_irq(tx_chn->tx_chn); 1750 - if (tx_chn->irq <= 0) { 1750 + if (tx_chn->irq < 0) { 1751 1751 dev_err(dev, "Failed to get tx dma irq %d\n", 1752 1752 tx_chn->irq); 1753 - ret = tx_chn->irq ?: -ENXIO; 1753 + ret = tx_chn->irq; 1754 1754 goto err; 1755 1755 } 1756 1756
+1 -3
drivers/net/ethernet/ti/icssg/icssg_prueth.c
··· 317 317 } 318 318 319 319 ret = k3_udma_glue_tx_get_irq(tx_chn->tx_chn); 320 - if (ret <= 0) { 321 - if (!ret) 322 - ret = -EINVAL; 320 + if (ret < 0) { 323 321 netdev_err(ndev, "failed to get tx irq\n"); 324 322 goto fail; 325 323 }