[SLOF] [PATCH v4 21/23] virtio: 1.0 helper to read 16/32/64 bit value
Nikunj A Dadhania
nikunj at linux.vnet.ibm.com
Fri Jan 29 15:53:04 AEDT 2016
Thomas Huth <thuth at redhat.com> writes:
> On 28.01.2016 11:24, Nikunj A Dadhania wrote:
>> To avoid cluttering the driver code with modern/legacy code introduce
>> virtio_cpu_to_modern{16,32,64} and virtio_modern{16,32,64}_to_cpu
>>
>> Signed-off-by: Nikunj A Dadhania <nikunj at linux.vnet.ibm.com>
>> Suggested-by: Thomas Huth <thuth at redhat.com>
>> ---
>> lib/libvirtio/virtio.c | 30 ++++++++++++++++++++++++++++++
>> lib/libvirtio/virtio.h | 6 ++++++
>> 2 files changed, 36 insertions(+)
>>
> +extern uint16_t virtio_cpu_to_modern16(struct virtio_device *dev, uint16_t val);
>> +extern uint32_t virtio_cpu_to_modern32(struct virtio_device *dev, uint32_t val);
>> +extern uint64_t virtio_cpu_to_modern64(struct virtio_device *dev, uint64_t val);
>> +extern uint16_t virtio_modern16_to_cpu(struct virtio_device *dev, uint16_t val);
>> +extern uint32_t virtio_modern32_to_cpu(struct virtio_device *dev, uint32_t val);
>> +extern uint64_t virtio_modern64_to_cpu(struct virtio_device *dev, uint64_t val);
>>
>> #endif /* _LIBVIRTIO_H */
>
> As suggested in my other mail earlier today, you could also move them
> as "static inline" into a local "virtio-internal.h" (or so) header
> file that does not get included from virtio.code. But I'm also fine if
> you keep them in virtio.c for now.
Let me make this change in the v5.
> Reviewed-by: Thomas Huth <thuth at redhat.com>
Regards
Nikunj
More information about the SLOF
mailing list