diff mbox

[v3,12/15] tools: rename 'xc_psr_cat_type' to 'xc_psr_type'

Message ID 1504603957-5389-13-git-send-email-yi.y.sun@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Yi Sun Sept. 5, 2017, 9:32 a.m. UTC
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@linux.intel.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Chao Peng <chao.p.peng@linux.intel.com>
---
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(-)

Comments

Roger Pau Monné Sept. 19, 2017, 10:34 a.m. UTC | #1
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@linux.intel.com>
> Acked-by: Wei Liu <wei.liu2@citrix.com>
> Reviewed-by: Chao Peng <chao.p.peng@linux.intel.com>
> ---
> 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.
Yi Sun Sept. 20, 2017, 6:25 a.m. UTC | #2
On 17-09-19 11:34:22, Roger Pau Monn� wrote:
> On Tue, Sep 05, 2017 at 05:32:34PM +0800, Yi Sun wrote:
> > @@ -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);
> 
Ok.

> Thanks, Roger.
diff mbox

Patch

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);
         if (xc_psr_cat_set_domain_data(ctx->xch, domid, xc_type,
                                        socketid, cbm)) {
             libxl__psr_cat_log_err_msg(gc, errno);
@@ -349,7 +349,7 @@  int libxl_psr_cat_get_cbm(libxl_ctx *ctx, uint32_t domid,
 {
     GC_INIT(ctx);
     int rc = 0;
-    xc_psr_cat_type xc_type = libxl__psr_cbm_type_to_libxc_psr_cat_type(type);
+    xc_psr_type xc_type = libxl__psr_cbm_type_to_libxc_psr_type(type);
 
     if (xc_psr_cat_get_domain_data(ctx->xch, domid, xc_type,
                                    target, cbm_r)) {