Hi Markus,
On 05/23/2017 06:27 AM, Markus Armbruster wrote:
[...]
There's one more cleanup opportunity:
[...]
if (pci_dma_read(dev, le64_to_cpu(info->desc.buf_addr), info->buf, size)) {
return NULL;
}
None of the pci_dma_read() calls outside rocker check the return value.
Just as well, because it always returns 0. Please clean this up in a
separate followup patch.
It may be the correct way to do it but this sounds like we are missing
something somewhere... pci_dma_read() calls pci_dma_rw() which always
returns 0. Why not let it returns void? It is inlined and never used by
address. Else we should document why returning 0 is correct, and what is
the reason to not use a void prototype.
pci_dma_rw() calls dma_memory_rw() which does return a boolean value,
false on success (MEMTX_OK) and true on error (MEMTX_ERROR/DECODE_ERROR)
Regards,
Phil.