diff mbox series

[v9,03/17] vdpa: Fix code indentation

Message ID 20210713084656.232-4-xieyongji@bytedance.com
State New
Headers show
Series Introduce VDUSE - vDPA Device in Userspace | expand

Commit Message

Yongji Xie July 13, 2021, 8:46 a.m. UTC
Use tabs to indent the code instead of spaces.

Signed-off-by: Xie Yongji <xieyongji@bytedance.com>
---
 include/linux/vdpa.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Joe Perches July 14, 2021, 4:20 a.m. UTC | #1
On Tue, 2021-07-13 at 16:46 +0800, Xie Yongji wrote:
> Use tabs to indent the code instead of spaces.


There are a lot more of these in this file.

$ ./scripts/checkpatch.pl --fix-inplace --strict include/linux/vdpa.h

and a little typing gives:
---
 include/linux/vdpa.h | 50 +++++++++++++++++++++++++-------------------------
 1 file changed, 25 insertions(+), 25 deletions(-)

diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h
index 3357ac98878d4..14cd4248e59fd 100644
--- a/include/linux/vdpa.h
+++ b/include/linux/vdpa.h
@@ -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;
@@ -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
@@ -277,13 +277,13 @@ struct vdpa_device *__vdpa_alloc_device(struct device *parent,
 					const struct vdpa_config_ops *config,
 					size_t size, const char *name);
 
-#define vdpa_alloc_device(dev_struct, member, parent, config, name)   \
-			  container_of(__vdpa_alloc_device( \
-				       parent, config, \
-				       sizeof(dev_struct) + \
-				       BUILD_BUG_ON_ZERO(offsetof( \
-				       dev_struct, member)), name), \
-				       dev_struct, member)
+#define vdpa_alloc_device(dev_struct, member, parent, config, name)	\
+	container_of(__vdpa_alloc_device(parent, config,		\
+					 sizeof(dev_struct) +		\
+					 BUILD_BUG_ON_ZERO(offsetof(dev_struct,	\
+								    member)), \
+					 name),				\
+		     dev_struct, member)
 
 int vdpa_register_device(struct vdpa_device *vdev, int nvqs);
 void vdpa_unregister_device(struct vdpa_device *vdev);
@@ -308,8 +308,8 @@ struct vdpa_driver {
 int __vdpa_register_driver(struct vdpa_driver *drv, struct module *owner);
 void vdpa_unregister_driver(struct vdpa_driver *drv);
 
-#define module_vdpa_driver(__vdpa_driver) \
-	module_driver(__vdpa_driver, vdpa_register_driver,	\
+#define module_vdpa_driver(__vdpa_driver)				\
+	module_driver(__vdpa_driver, vdpa_register_driver,		\
 		      vdpa_unregister_driver)
 
 static inline struct vdpa_driver *drv_to_vdpa(struct device_driver *driver)
@@ -339,25 +339,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,
+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.
Yongji Xie July 14, 2021, 5:48 a.m. UTC | #2
On Wed, Jul 14, 2021 at 12:20 PM Joe Perches <joe@perches.com> wrote:
>

> On Tue, 2021-07-13 at 16:46 +0800, Xie Yongji wrote:

> > Use tabs to indent the code instead of spaces.

>

> There are a lot more of these in this file.

>

> $ ./scripts/checkpatch.pl --fix-inplace --strict include/linux/vdpa.h

>

> and a little typing gives:

> ---

>  include/linux/vdpa.h | 50 +++++++++++++++++++++++++-------------------------

>  1 file changed, 25 insertions(+), 25 deletions(-)

>

> diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h

> index 3357ac98878d4..14cd4248e59fd 100644

> --- a/include/linux/vdpa.h

> +++ b/include/linux/vdpa.h

> @@ -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;

> @@ -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

> @@ -277,13 +277,13 @@ struct vdpa_device *__vdpa_alloc_device(struct device *parent,

>                                         const struct vdpa_config_ops *config,

>                                         size_t size, const char *name);

>

> -#define vdpa_alloc_device(dev_struct, member, parent, config, name)   \

> -                         container_of(__vdpa_alloc_device( \

> -                                      parent, config, \

> -                                      sizeof(dev_struct) + \

> -                                      BUILD_BUG_ON_ZERO(offsetof( \

> -                                      dev_struct, member)), name), \

> -                                      dev_struct, member)

> +#define vdpa_alloc_device(dev_struct, member, parent, config, name)    \

> +       container_of(__vdpa_alloc_device(parent, config,                \

> +                                        sizeof(dev_struct) +           \

> +                                        BUILD_BUG_ON_ZERO(offsetof(dev_struct, \

> +                                                                   member)), \

> +                                        name),                         \

> +                    dev_struct, member)

>

>  int vdpa_register_device(struct vdpa_device *vdev, int nvqs);

>  void vdpa_unregister_device(struct vdpa_device *vdev);

> @@ -308,8 +308,8 @@ struct vdpa_driver {

>  int __vdpa_register_driver(struct vdpa_driver *drv, struct module *owner);

>  void vdpa_unregister_driver(struct vdpa_driver *drv);

>

> -#define module_vdpa_driver(__vdpa_driver) \

> -       module_driver(__vdpa_driver, vdpa_register_driver,      \

> +#define module_vdpa_driver(__vdpa_driver)                              \

> +       module_driver(__vdpa_driver, vdpa_register_driver,              \

>                       vdpa_unregister_driver)

>

>  static inline struct vdpa_driver *drv_to_vdpa(struct device_driver *driver)

> @@ -339,25 +339,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,

> +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.

>

>


Oh, yes. I miss that. Thanks for the reminder!

Will fix it in the next version.

Thanks,
Yongji
diff mbox series

Patch

diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h
index 7c49bc5a2b71..f822490db584 100644
--- a/include/linux/vdpa.h
+++ b/include/linux/vdpa.h
@@ -342,25 +342,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)
 {
-        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.