|
From: | Philippe Mathieu-Daudé |
Subject: | Re: [Qemu-devel] [PATCH v5 1/4] net/rocker: Remove the dead error handling |
Date: | Wed, 24 May 2017 01:43:04 -0300 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
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.
[Prev in Thread] | Current Thread | [Next in Thread] |