Message ID | 20180124111721.8170-1-yuval.shaia@oracle.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
On Wed, 2018-01-24 at 13:17 +0200, Yuval Shaia wrote: > - if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) == 0) { > + if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) { Sorry but I absolutely don't like this change. I think testing a return value using "== 0" is easier to read than using !. Bart.
diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c index d650a9fcde24..6f50220295c8 100644 --- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c +++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c @@ -837,16 +837,16 @@ static int pvrdma_pci_probe(struct pci_dev *pdev, } /* Enable 64-Bit DMA */ - if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) == 0) { + if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) { ret = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64)); - if (ret != 0) { + if (ret) { dev_err(&pdev->dev, "pci_set_consistent_dma_mask failed\n"); goto err_free_resource; } } else { ret = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); - if (ret != 0) { + if (ret) { dev_err(&pdev->dev, "pci_set_dma_mask failed\n"); goto err_free_resource;
To be compatible with other modules/drivers, change return code checks from "if (rc != 0)" to "if (rc)". Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com> --- drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)