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

Re: [Xen-devel] [PATCH v3 12/15] tools: rename 'xc_psr_cat_type' to 'xc_psr_type'



On Tue, Sep 05, 2017 at 05:32:34PM +0800, Yi Sun wrote:
> This patch renames 'xc_psr_cat_type' to 'xc_psr_type' so that
> the structure name is common for all allocation features.
> 
> Signed-off-by: Yi Sun <yi.y.sun@xxxxxxxxxxxxxxx>
> Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
> Reviewed-by: Chao Peng <chao.p.peng@xxxxxxxxxxxxxxx>
> ---
> v3:
>     - change 'xc_psr_val_type' to 'xc_psr_type'.
>       (suggested by Roger Pau Monné)
> ---
>  tools/libxc/include/xenctrl.h |  8 ++++----
>  tools/libxc/xc_psr.c          |  4 ++--
>  tools/libxl/libxl_psr.c       | 12 ++++++------
>  3 files changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
> index bbdf8e2..63b92d2 100644
> --- a/tools/libxc/include/xenctrl.h
> +++ b/tools/libxc/include/xenctrl.h
> @@ -2450,13 +2450,13 @@ enum xc_psr_cmt_type {
>  };
>  typedef enum xc_psr_cmt_type xc_psr_cmt_type;
>  
> -enum xc_psr_cat_type {
> +enum xc_psr_type {
>      XC_PSR_CAT_L3_CBM      = 1,
>      XC_PSR_CAT_L3_CBM_CODE = 2,
>      XC_PSR_CAT_L3_CBM_DATA = 3,
>      XC_PSR_CAT_L2_CBM      = 4,
>  };
> -typedef enum xc_psr_cat_type xc_psr_cat_type;
> +typedef enum xc_psr_type xc_psr_type;
>  
>  enum xc_psr_feat_type {
>      XC_PSR_FEAT_UNKNOWN,
> @@ -2499,10 +2499,10 @@ int xc_psr_cmt_get_data(xc_interface *xch, uint32_t 
> rmid, uint32_t cpu,
>  int xc_psr_cmt_enabled(xc_interface *xch);
>  
>  int xc_psr_cat_set_domain_data(xc_interface *xch, uint32_t domid,
> -                               xc_psr_cat_type type, uint32_t target,
> +                               xc_psr_type type, uint32_t target,
>                                 uint64_t data);
>  int xc_psr_cat_get_domain_data(xc_interface *xch, uint32_t domid,
> -                               xc_psr_cat_type type, uint32_t target,
> +                               xc_psr_type type, uint32_t target,
>                                 uint64_t *data);
>  int xc_psr_get_hw_info(xc_interface *xch, uint32_t socket,
>                         xc_psr_feat_type type, xc_psr_hw_info *hw_info);
> diff --git a/tools/libxc/xc_psr.c b/tools/libxc/xc_psr.c
> index a8a750a..80642a2 100644
> --- a/tools/libxc/xc_psr.c
> +++ b/tools/libxc/xc_psr.c
> @@ -249,7 +249,7 @@ int xc_psr_cmt_enabled(xc_interface *xch)
>      return 0;
>  }
>  int xc_psr_cat_set_domain_data(xc_interface *xch, uint32_t domid,
> -                               xc_psr_cat_type type, uint32_t target,
> +                               xc_psr_type type, uint32_t target,
>                                 uint64_t data)
>  {
>      DECLARE_DOMCTL;
> @@ -284,7 +284,7 @@ int xc_psr_cat_set_domain_data(xc_interface *xch, 
> uint32_t domid,
>  }
>  
>  int xc_psr_cat_get_domain_data(xc_interface *xch, uint32_t domid,
> -                               xc_psr_cat_type type, uint32_t target,
> +                               xc_psr_type type, uint32_t target,
>                                 uint64_t *data)
>  {
>      int rc;
> diff --git a/tools/libxl/libxl_psr.c b/tools/libxl/libxl_psr.c
> index d534ec2..c8d2921 100644
> --- a/tools/libxl/libxl_psr.c
> +++ b/tools/libxl/libxl_psr.c
> @@ -303,11 +303,11 @@ out:
>      return rc;
>  }
>  
> -static inline xc_psr_cat_type libxl__psr_cbm_type_to_libxc_psr_cat_type(
> +static inline xc_psr_type libxl__psr_cbm_type_to_libxc_psr_type(
>      libxl_psr_cbm_type type)
>  {
> -    BUILD_BUG_ON(sizeof(libxl_psr_cbm_type) != sizeof(xc_psr_cat_type));
> -    return (xc_psr_cat_type)type;
> +    BUILD_BUG_ON(sizeof(libxl_psr_cbm_type) != sizeof(xc_psr_type));
> +    return (xc_psr_type)type;
>  }
>  
>  int libxl_psr_cat_set_cbm(libxl_ctx *ctx, uint32_t domid,
> @@ -325,12 +325,12 @@ int libxl_psr_cat_set_cbm(libxl_ctx *ctx, uint32_t 
> domid,
>      }
>  
>      libxl_for_each_set_bit(socketid, *target_map) {
> -        xc_psr_cat_type xc_type;
> +        xc_psr_type xc_type;
>  
>          if (socketid >= nr_sockets)
>              break;
>  
> -        xc_type = libxl__psr_cbm_type_to_libxc_psr_cat_type(type);
> +        xc_type = libxl__psr_cbm_type_to_libxc_psr_type(type);

You can place this with the variable declaration:

xc_psr_type xc_type = libxl__psr_cbm_type_to_libxc_psr_type(type);

Thanks, Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

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