[PATCH] misc: pci_endpoint_test: Remove superfluous code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



There are two things that made me read this code multiple times:

1) There is a parenthesis around the first conditional, but not
around the second conditional. This is inconsistent, and makes
you assume that the return value should be treated differently.

2) There is no need to explicitly write != 0 in a conditional.

Remove the superfluous parenthesis and != 0.

No functional change intended.

Signed-off-by: Niklas Cassel <cassel@xxxxxxxxxx>
---
 drivers/misc/pci_endpoint_test.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/pci_endpoint_test.c b/drivers/misc/pci_endpoint_test.c
index bf64d3aff7d8..1005dfdf664e 100644
--- a/drivers/misc/pci_endpoint_test.c
+++ b/drivers/misc/pci_endpoint_test.c
@@ -854,8 +854,8 @@ static int pci_endpoint_test_probe(struct pci_dev *pdev,
 	init_completion(&test->irq_raised);
 	mutex_init(&test->mutex);
 
-	if ((dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(48)) != 0) &&
-	    dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)) != 0) {
+	if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(48)) &&
+	    dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) {
 		dev_err(dev, "Cannot set DMA mask\n");
 		return -EINVAL;
 	}
-- 
2.44.0





[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux