From: Sasha Levin Date: Sun, 14 Aug 2011 14:52:32 +0000 (+0300) Subject: virtio_config: Add virtio_config_val_len() X-Git-Tag: next-20110826~42^2~2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=35edf7fc8f1fede2bf648744bd37dca9bc65d390;p=karo-tx-linux.git virtio_config: Add virtio_config_val_len() This patch adds virtio_config_val_len() which allows retrieving variable length data from the virtio config space only if a specific feature is on. Cc: Amit Shah Cc: "Michael S. Tsirkin" Cc: Rusty Russell Cc: virtualization@lists.linux-foundation.org Signed-off-by: Sasha Levin Signed-off-by: Rusty Russell --- diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index 39c88c5ad19d..add4790b21fe 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h @@ -155,6 +155,9 @@ static inline bool virtio_has_feature(const struct virtio_device *vdev, #define virtio_config_val(vdev, fbit, offset, v) \ virtio_config_buf((vdev), (fbit), (offset), (v), sizeof(*v)) +#define virtio_config_val_len(vdev, fbit, offset, v, len) \ + virtio_config_buf((vdev), (fbit), (offset), (v), (len)) + static inline int virtio_config_buf(struct virtio_device *vdev, unsigned int fbit, unsigned int offset,