[U-Boot] [PATCH 03/27] virtio: Add codes for virtual queue/ring management

Simon Glass sjg at chromium.org
Fri Oct 12 00:00:00 UTC 2018


Hi Bin,

On 11 October 2018 at 03:50, Bin Meng <bmeng.cn at gmail.com> wrote:
> Hi Simon,
>
> On Thu, Sep 27, 2018 at 9:42 PM Simon Glass <sjg at chromium.org> wrote:
>>
>> On 23 September 2018 at 06:42, Bin Meng <bmeng.cn at gmail.com> wrote:
>> > From: Tuomas Tynkkynen <tuomas.tynkkynen at iki.fi>
>> >
>> > This adds support for managing virtual queue/ring, the channel
>> > for high performance I/O between host and guest.
>> >
>> > Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen at iki.fi>
>> > Signed-off-by: Bin Meng <bmeng.cn at gmail.com>
>> > ---
>> >
>> >  drivers/virtio/Makefile      |   2 +-
>> >  drivers/virtio/virtio_ring.c | 356 +++++++++++++++++++++++++++++++++++++++++++
>> >  include/virtio_ring.h        | 320 ++++++++++++++++++++++++++++++++++++++
>> >  3 files changed, 677 insertions(+), 1 deletion(-)
>> >  create mode 100644 drivers/virtio/virtio_ring.c
>> >  create mode 100644 include/virtio_ring.h
>>
>> Seems like vring_create_virtqueue() should return an error code rather
>> than a pointer?
>
> I think NULL as a pointer can be a sign for the error.

Yes but the issue here is that it returns more than one error, so an
in is easier. With NULL you don't know what went wrong. There is
ERR_PTR of course.

Regards,
Simon


More information about the U-Boot mailing list