lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 29 Apr 2024 14:49:48 -0400
From: "Michael S. Tsirkin" <mst@...hat.com>
To: Gavin Shan <gshan@...hat.com>
Cc: virtualization@...ts.linux.dev, linux-kernel@...r.kernel.org,
	jasowang@...hat.com, shan.gavin@...il.com
Subject: Re: [PATCH v2 4/4] vhost: Reformat vhost_{get, put}_user()

On Mon, Apr 29, 2024 at 08:14:00PM +1000, Gavin Shan wrote:
> Reformat the macros to use tab as the terminator for each line so
> that it looks clean.
> 
> No functional change intended.
> 
> Signed-off-by: Gavin Shan <gshan@...hat.com>

Just messes up history for no real gain.

> ---
>  drivers/vhost/vhost.c | 60 +++++++++++++++++++++----------------------
>  1 file changed, 30 insertions(+), 30 deletions(-)
> 
> diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
> index 4ddb9ec2fe46..c1ed5e750521 100644
> --- a/drivers/vhost/vhost.c
> +++ b/drivers/vhost/vhost.c
> @@ -1207,21 +1207,22 @@ static inline void __user *__vhost_get_user(struct vhost_virtqueue *vq,
>  	return __vhost_get_user_slow(vq, addr, size, type);
>  }
>  
> -#define vhost_put_user(vq, x, ptr)		\
> -({ \
> -	int ret; \
> -	if (!vq->iotlb) { \
> -		ret = __put_user(x, ptr); \
> -	} else { \
> -		__typeof__(ptr) to = \
> +#define vhost_put_user(vq, x, ptr)					\
> +({									\
> +	int ret;							\
> +	if (!vq->iotlb) {						\
> +		ret = __put_user(x, ptr);				\
> +	} else {							\
> +		__typeof__(ptr) to =					\
>  			(__typeof__(ptr)) __vhost_get_user(vq, ptr,	\
> -					  sizeof(*ptr), VHOST_ADDR_USED); \
> -		if (to != NULL) \
> -			ret = __put_user(x, to); \
> -		else \
> -			ret = -EFAULT;	\
> -	} \
> -	ret; \
> +						sizeof(*ptr),		\
> +						VHOST_ADDR_USED);	\
> +		if (to != NULL)						\
> +			ret = __put_user(x, to);			\
> +		else							\
> +			ret = -EFAULT;					\
> +	}								\
> +	ret;								\
>  })
>  
>  static inline int vhost_put_avail_event(struct vhost_virtqueue *vq)
> @@ -1252,22 +1253,21 @@ static inline int vhost_put_used_idx(struct vhost_virtqueue *vq)
>  			      &vq->used->idx);
>  }
>  
> -#define vhost_get_user(vq, x, ptr, type)		\
> -({ \
> -	int ret; \
> -	if (!vq->iotlb) { \
> -		ret = __get_user(x, ptr); \
> -	} else { \
> -		__typeof__(ptr) from = \
> -			(__typeof__(ptr)) __vhost_get_user(vq, ptr, \
> -							   sizeof(*ptr), \
> -							   type); \
> -		if (from != NULL) \
> -			ret = __get_user(x, from); \
> -		else \
> -			ret = -EFAULT; \
> -	} \
> -	ret; \
> +#define vhost_get_user(vq, x, ptr, type)				\
> +({									\
> +	int ret;							\
> +	if (!vq->iotlb) {						\
> +		ret = __get_user(x, ptr);				\
> +	} else {							\
> +		__typeof__(ptr) from =					\
> +			(__typeof__(ptr)) __vhost_get_user(vq, ptr,	\
> +						sizeof(*ptr), type);	\
> +		if (from != NULL)					\
> +			ret = __get_user(x, from);			\
> +		else							\
> +			ret = -EFAULT;					\
> +	}								\
> +	ret;								\
>  })
>  
>  #define vhost_get_avail(vq, x, ptr) \
> -- 
> 2.44.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ