Skip to content

Commit

Permalink
virtio_config: fix len calculation of config elements
Browse files Browse the repository at this point in the history
Rusty,

This patch is a prereq for the virtio_blk blocksize patch, please apply it
first.

Adding an u32 value to the virtio_blk_config unconvered a small bug the config
space defintions:
v is a pointer, to we have to use sizeof(*v) instead of sizeof(v).

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
Christian Borntraeger authored and Rusty Russell committed May 30, 2008
1 parent 52a3a05 commit 7f31fe0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/virtio_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ static inline bool virtio_has_feature(const struct virtio_device *vdev,
* The return value is -ENOENT if the feature doesn't exist. Otherwise
* the config value is copied into whatever is pointed to by v. */
#define virtio_config_val(vdev, fbit, offset, v) \
virtio_config_buf((vdev), (fbit), (offset), (v), sizeof(v))
virtio_config_buf((vdev), (fbit), (offset), (v), sizeof(*v))

static inline int virtio_config_buf(struct virtio_device *vdev,
unsigned int fbit,
Expand Down

0 comments on commit 7f31fe0

Please sign in to comment.