[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RESEND][PATCH v2 7/7] xen/guest_access: Fix coding style in xen/guest_access.h


  • To: Julien Grall <julien@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Fri, 31 Jul 2020 12:46:37 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eQl4wNDKcbTGDFmi+x4LzPFfB0nI4NfrbsFPh62FtZg=; b=BU9IdyMkfkuxC43+JNOW4Z1aOQDuchsA/ykGbHlg+MtWGdGzmH0xzOQ82I+MybFqmxSPpS0Gpo3+iDgYvO/hj8W6l4g+gkEzEtTsIu/g9r1NM2q4oblnptvD2l+71IAuY1JCCjFZZHulPYj7H0jOKgTfc1+SfIQfQ3R4Jvt66OvUeHK7DggCzItCfQa6iRNpeYtAJFCQP8Q6CkykNfPT4apI5Jfj3ZvdsryFFY43DzAesiAs/IvdNgTjrCnSFAUr8gN/DaV/R2T1nbsqh0pgeNlCwYykJM/fGLIifok3VknxQQkKvgq7wvcLJ+/ny0oUJMnKkeuAwcm8XP57ywNWxA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZHcRYos/s2YchWMhzLYHYwAl46TvA7YpzbpXnys2i5adjCAeOYzh9YMjR8V1oMI4BRnlW+jzwM3NqRDUyy/utd8RbCRz9buVz3B8sIsNelpKcuc5Y1hvxCUvTuo8Ons3Od71Wcn3U4tn/O3P6PhBDjz74hDVqOBGrzEkwC6sw0od7gqXnv1Cz38O+TbX47n2xJwyu4Jitlg4EDKLvkYzIElqGdcPd7YLbvr1T4Aq52jhyN+0JVd7Pcl9fv6SDg3sfWUFy63eOiRasxS7grF7xRl4JEcyV7587CrXM4xAGORu41zo2x0h2jtCBg23hqsOpKTeRXf6aso2Xn5RywSAZA==
  • Authentication-results-original: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Julien Grall <jgrall@xxxxxxxxxx>, Ian Jackson <ian.jackson@xxxxxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, nd <nd@xxxxxxx>
  • Delivery-date: Fri, 31 Jul 2020 12:46:50 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHWZp4mnyA5b3r8N0qp4y2QMyc1KKkhpAQA
  • Thread-topic: [RESEND][PATCH v2 7/7] xen/guest_access: Fix coding style in xen/guest_access.h


> On 30 Jul 2020, at 20:18, Julien Grall <julien@xxxxxxx> wrote:
> 
> From: Julien Grall <jgrall@xxxxxxxxxx>
> 
>    * Add space before and after operator
>    * Align \
>    * Format comments
> 
> No functional changes expected.
> 
> Signed-off-by: Julien Grall <jgrall@xxxxxxxxxx>
Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>

> ---
> xen/include/xen/guest_access.h | 36 +++++++++++++++++++---------------
> 1 file changed, 20 insertions(+), 16 deletions(-)
> 
> diff --git a/xen/include/xen/guest_access.h b/xen/include/xen/guest_access.h
> index 4957b8d1f2b8..52fc7a063249 100644
> --- a/xen/include/xen/guest_access.h
> +++ b/xen/include/xen/guest_access.h
> @@ -18,20 +18,24 @@
> #define guest_handle_add_offset(hnd, nr) ((hnd).p += (nr))
> #define guest_handle_subtract_offset(hnd, nr) ((hnd).p -= (nr))
> 
> -/* Cast a guest handle (either XEN_GUEST_HANDLE or XEN_GUEST_HANDLE_PARAM)
> - * to the specified type of XEN_GUEST_HANDLE_PARAM. */
> +/*
> + * Cast a guest handle (either XEN_GUEST_HANDLE or XEN_GUEST_HANDLE_PARAM)
> + * to the specified type of XEN_GUEST_HANDLE_PARAM.
> + */
> #define guest_handle_cast(hnd, type) ({         \
>     type *_x = (hnd).p;                         \
> -    (XEN_GUEST_HANDLE_PARAM(type)) { _x };            \
> +    (XEN_GUEST_HANDLE_PARAM(type)) { _x };      \
> })
> 
> /* Cast a XEN_GUEST_HANDLE to XEN_GUEST_HANDLE_PARAM */
> #define guest_handle_to_param(hnd, type) ({                  \
>     typeof((hnd).p) _x = (hnd).p;                            \
>     XEN_GUEST_HANDLE_PARAM(type) _y = { _x };                \
> -    /* type checking: make sure that the pointers inside     \
> +    /*                                                       \
> +     * type checking: make sure that the pointers inside     \
>      * XEN_GUEST_HANDLE and XEN_GUEST_HANDLE_PARAM are of    \
> -     * the same type, then return hnd */                     \
> +     * the same type, then return hnd.                       \
> +     */                                                      \
>     (void)(&_x == &_y.p);                                    \
>     _y;                                                      \
> })
> @@ -106,13 +110,13 @@
>  * guest_handle_subrange_okay().
>  */
> 
> -#define __copy_to_guest_offset(hnd, off, ptr, nr) ({    \
> -    const typeof(*(ptr)) *_s = (ptr);                   \
> -    char (*_d)[sizeof(*_s)] = (void *)(hnd).p;          \
> -    /* Check that the handle is not for a const type */ \
> -    void *__maybe_unused _t = (hnd).p;                  \
> -    (void)((hnd).p == _s);                              \
> -    __raw_copy_to_guest(_d+(off), _s, sizeof(*_s)*(nr));\
> +#define __copy_to_guest_offset(hnd, off, ptr, nr) ({        \
> +    const typeof(*(ptr)) *_s = (ptr);                       \
> +    char (*_d)[sizeof(*_s)] = (void *)(hnd).p;              \
> +    /* Check that the handle is not for a const type */     \
> +    void *__maybe_unused _t = (hnd).p;                      \
> +    (void)((hnd).p == _s);                                  \
> +    __raw_copy_to_guest(_d + (off), _s, sizeof(*_s) * (nr));\
> })
> 
> #define __clear_guest_offset(hnd, off, nr) ({    \
> @@ -120,10 +124,10 @@
>     __raw_clear_guest(_d + (off), nr);           \
> })
> 
> -#define __copy_from_guest_offset(ptr, hnd, off, nr) ({  \
> -    const typeof(*(ptr)) *_s = (hnd).p;                 \
> -    typeof(*(ptr)) *_d = (ptr);                         \
> -    __raw_copy_from_guest(_d, _s+(off), sizeof(*_d)*(nr));\
> +#define __copy_from_guest_offset(ptr, hnd, off, nr) ({          \
> +    const typeof(*(ptr)) *_s = (hnd).p;                         \
> +    typeof(*(ptr)) *_d = (ptr);                                 \
> +    __raw_copy_from_guest(_d, _s + (off), sizeof (*_d) * (nr)); \
> })
> 
> #define __copy_field_to_guest(hnd, ptr, field) ({       \
> -- 
> 2.17.1
> 
> 




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.