diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2020-08-05 09:17:38 -0400 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2020-08-05 11:08:41 -0400 |
commit | 035ce4210be1257dd417785ff7818b5c0f2205fb (patch) | |
tree | 532db27bb4c6798aea5dd3596ebad5dfdbd7d008 | |
parent | e3e7994d53082e48d2a6a248376683d3be3dff9d (diff) | |
download | lwn-035ce4210be1257dd417785ff7818b5c0f2205fb.tar.gz lwn-035ce4210be1257dd417785ff7818b5c0f2205fb.zip |
virtio_config: add virtio_cread_le_feature
Mirrors virtio_cread_feature but for LE fields.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r-- | include/linux/virtio_config.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index 5b5196fec899..cc7a2b1fd7b2 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h @@ -555,4 +555,14 @@ static inline void virtio_cwrite64(struct virtio_device *vdev, _r; \ }) +/* Conditional config space accessors. */ +#define virtio_cread_le_feature(vdev, fbit, structname, member, ptr) \ + ({ \ + int _r = 0; \ + if (!virtio_has_feature(vdev, fbit)) \ + _r = -ENOENT; \ + else \ + virtio_cread_le((vdev), structname, member, ptr); \ + _r; \ + }) #endif /* _LINUX_VIRTIO_CONFIG_H */ |