* [bug report] PCI/P2PDMA: Support peer-to-peer memory
@ 2018-10-17 8:45 Dan Carpenter
2018-10-17 13:34 ` Christoph Hellwig
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2018-10-17 8:45 UTC (permalink / raw)
To: logang; +Cc: linux-pci
Hello Logan Gunthorpe,
This is a semi-automatic email about new static checker warnings.
The patch 31fd98513249: "PCI/P2PDMA: Support peer-to-peer memory"
from Oct 4, 2018, leads to the following Smatch complaint:
drivers/pci/p2pdma.c:684 pci_p2pmem_publish()
error: we previously assumed 'pdev->p2pdma' could be null (see line 681)
drivers/pci/p2pdma.c
680 {
681 if (publish && !pdev->p2pdma)
^^^^^^^^^^^^^^^^^^^^^^^^
It feels like this should just be:
if (!pdev->p2pdma)
In other words, I don't understand why we are testing "publish"...
682 return;
683
684 pdev->p2pdma->p2pmem_published = publish;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
685 }
686 EXPORT_SYMBOL_GPL(pci_p2pmem_publish);
regards,
dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [bug report] PCI/P2PDMA: Support peer-to-peer memory
2018-10-17 8:45 [bug report] PCI/P2PDMA: Support peer-to-peer memory Dan Carpenter
@ 2018-10-17 13:34 ` Christoph Hellwig
0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2018-10-17 13:34 UTC (permalink / raw)
To: Dan Carpenter; +Cc: logang, linux-pci
> if (!pdev->p2pdma)
>
> In other words, I don't understand why we are testing "publish"...
>
> 682 return;
> 683
> 684 pdev->p2pdma->p2pmem_published = publish;
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. or simplify it even further to:
if (pdev->p2pdma)
pdev->p2pdma->p2pmem_published = publish;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-10-17 13:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-17 8:45 [bug report] PCI/P2PDMA: Support peer-to-peer memory Dan Carpenter
2018-10-17 13:34 ` Christoph Hellwig
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.