提交 3102b8bb 编写于 作者: X Xie Yongji 提交者: Pengyuan Zhao

vdpa: Fix some coding style issues

mainline inclusion
from mainline-v5.15-rc1
commit 86e17a51
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I5WXCZ
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=86e17a51c1a5a299009f8b1645e3e9da0d59faae

----------------------------------------------------------------------

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: NXie Yongji <xieyongji@bytedance.com>
Acked-by: NJason Wang <jasowang@redhat.com>
Reviewed-by: NStefano Garzarella <sgarzare@redhat.com>
Link: https://lore.kernel.org/r/20210831103634.33-5-xieyongji@bytedance.comSigned-off-by: NMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: NPengyuan Zhao <zhaopengyuan@hisilicon.com>
上级 1f30edd9
...@@ -43,17 +43,17 @@ struct vdpa_vq_state_split { ...@@ -43,17 +43,17 @@ struct vdpa_vq_state_split {
* @last_used_idx: used index * @last_used_idx: used index
*/ */
struct vdpa_vq_state_packed { struct vdpa_vq_state_packed {
u16 last_avail_counter:1; u16 last_avail_counter:1;
u16 last_avail_idx:15; u16 last_avail_idx:15;
u16 last_used_counter:1; u16 last_used_counter:1;
u16 last_used_idx:15; u16 last_used_idx:15;
}; };
struct vdpa_vq_state { struct vdpa_vq_state {
union { union {
struct vdpa_vq_state_split split; struct vdpa_vq_state_split split;
struct vdpa_vq_state_packed packed; struct vdpa_vq_state_packed packed;
}; };
}; };
struct vdpa_mgmt_dev; struct vdpa_mgmt_dev;
...@@ -133,7 +133,7 @@ struct vdpa_iova_range { ...@@ -133,7 +133,7 @@ struct vdpa_iova_range {
* @vdev: vdpa device * @vdev: vdpa device
* @idx: virtqueue index * @idx: virtqueue index
* @state: pointer to returned state (last_avail_idx) * @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 * @vdev: vdpa device
* @idx: virtqueue index * @idx: virtqueue index
* Returns the notifcation area * Returns the notifcation area
...@@ -357,25 +357,26 @@ static inline struct device *vdpa_get_dma_dev(struct vdpa_device *vdev) ...@@ -357,25 +357,26 @@ static inline struct device *vdpa_get_dma_dev(struct vdpa_device *vdev)
static inline int vdpa_reset(struct vdpa_device *vdev) static inline int 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; vdev->features_valid = false;
return ops->reset(vdev); return ops->reset(vdev);
} }
static inline int vdpa_set_features(struct vdpa_device *vdev, u64 features) 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; 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, static inline void vdpa_get_config(struct vdpa_device *vdev,
void *buf, unsigned int len) unsigned 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. * Config accesses aren't supposed to trigger before features are set.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册