Skip to content

Commit

Permalink
vdpa: Fix some coding style issues
Browse files Browse the repository at this point in the history
Fix some code indent issues and following checkpatch warning:

WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
371: FILE: include/linux/vdpa.h:371:
+static inline void vdpa_get_config(struct vdpa_device *vdev, unsigned offset,

Signed-off-by: Xie Yongji <xieyongji@bytedance.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Link: https://lore.kernel.org/r/20210831103634.33-5-xieyongji@bytedance.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
  • Loading branch information
Xie Yongji authored and Michael S. Tsirkin committed Sep 6, 2021
1 parent 9c93005 commit 86e17a5
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions include/linux/vdpa.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@ struct vdpa_vq_state_split {
* @last_used_idx: used index
*/
struct vdpa_vq_state_packed {
u16 last_avail_counter:1;
u16 last_avail_idx:15;
u16 last_used_counter:1;
u16 last_used_idx:15;
u16 last_avail_counter:1;
u16 last_avail_idx:15;
u16 last_used_counter:1;
u16 last_used_idx:15;
};

struct vdpa_vq_state {
union {
struct vdpa_vq_state_split split;
struct vdpa_vq_state_packed packed;
};
union {
struct vdpa_vq_state_split split;
struct vdpa_vq_state_packed packed;
};
};

struct vdpa_mgmt_dev;
Expand Down Expand Up @@ -131,7 +131,7 @@ struct vdpa_iova_range {
* @vdev: vdpa device
* @idx: virtqueue index
* @state: pointer to returned state (last_avail_idx)
* @get_vq_notification: Get the notification area for a virtqueue
* @get_vq_notification: Get the notification area for a virtqueue
* @vdev: vdpa device
* @idx: virtqueue index
* Returns the notifcation area
Expand Down Expand Up @@ -350,25 +350,25 @@ static inline struct device *vdpa_get_dma_dev(struct vdpa_device *vdev)

static inline void vdpa_reset(struct vdpa_device *vdev)
{
const struct vdpa_config_ops *ops = vdev->config;
const struct vdpa_config_ops *ops = vdev->config;

vdev->features_valid = false;
ops->set_status(vdev, 0);
ops->set_status(vdev, 0);
}

static inline int vdpa_set_features(struct vdpa_device *vdev, u64 features)
{
const struct vdpa_config_ops *ops = vdev->config;
const struct vdpa_config_ops *ops = vdev->config;

vdev->features_valid = true;
return ops->set_features(vdev, features);
return ops->set_features(vdev, features);
}


static inline void vdpa_get_config(struct vdpa_device *vdev, unsigned offset,
void *buf, unsigned int len)
static inline void vdpa_get_config(struct vdpa_device *vdev,
unsigned int offset, void *buf,
unsigned int len)
{
const struct vdpa_config_ops *ops = vdev->config;
const struct vdpa_config_ops *ops = vdev->config;

/*
* Config accesses aren't supposed to trigger before features are set.
Expand Down

0 comments on commit 86e17a5

Please sign in to comment.