All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yi Sun <yi.y.sun@linux.intel.com>
To: xen-devel@lists.xenproject.org
Cc: wei.liu2@citrix.com, ian.jackson@eu.citrix.com,
	Yi Sun <yi.y.sun@linux.intel.com>,
	roger.pau@citrix.com
Subject: [PATCH] tools: change the type of '*nr' in 'libxl_psr_cat_get_info'
Date: Fri,  1 Sep 2017 14:59:23 +0800	[thread overview]
Message-ID: <1504249163-27185-1-git-send-email-yi.y.sun@linux.intel.com> (raw)
In-Reply-To: <1504166886-3912-1-git-send-email-yi.y.sun@linux.intel.com>

Due to historical reason, type of parameter '*nr' in 'libxl_psr_cat_get_info'
is 'int'. But this is not right. It should be 'unsigned int'. This patch fixes
this and does related changes.

Suggested-by: Roger Pau Monné <roger.pau@citrix.com>
Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com>
---
    - This patch depends on patch 'tools: remove unnecessary PSR macros'.
---
 tools/libxl/libxl.h     | 2 +-
 tools/libxl/libxl_psr.c | 6 ++++--
 tools/xl/xl_psr.c       | 9 ++++-----
 3 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index a0185b9..0c90c41 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -2210,7 +2210,7 @@ int libxl_psr_cat_get_cbm(libxl_ctx *ctx, uint32_t domid,
  * and the length in 'nr'.
  */
 int libxl_psr_cat_get_info(libxl_ctx *ctx, libxl_psr_cat_info **info,
-                           int *nr, unsigned int lvl);
+                           unsigned int *nr, unsigned int lvl);
 int libxl_psr_cat_get_l3_info(libxl_ctx *ctx, libxl_psr_cat_info **info,
                               int *nr);
 void libxl_psr_cat_info_list_free(libxl_psr_cat_info *list, int nr);
diff --git a/tools/libxl/libxl_psr.c b/tools/libxl/libxl_psr.c
index f55ba1e..7366481 100644
--- a/tools/libxl/libxl_psr.c
+++ b/tools/libxl/libxl_psr.c
@@ -362,7 +362,7 @@ int libxl_psr_cat_get_cbm(libxl_ctx *ctx, uint32_t domid,
 }
 
 int libxl_psr_cat_get_info(libxl_ctx *ctx, libxl_psr_cat_info **info,
-                           int *nr, unsigned int lvl)
+                           unsigned int *nr, unsigned int lvl)
 {
     GC_INIT(ctx);
     int rc;
@@ -410,8 +410,10 @@ int libxl_psr_cat_get_l3_info(libxl_ctx *ctx, libxl_psr_cat_info **info,
                               int *nr)
 {
     int rc;
+    unsigned int num;
 
-    rc = libxl_psr_cat_get_info(ctx, info, nr, 3);
+    rc = libxl_psr_cat_get_info(ctx, info, &num, 3);
+    *nr = num;
 
     return rc;
 }
diff --git a/tools/xl/xl_psr.c b/tools/xl/xl_psr.c
index 544f6f0..ef00048 100644
--- a/tools/xl/xl_psr.c
+++ b/tools/xl/xl_psr.c
@@ -294,8 +294,8 @@ int main_psr_cmt_show(int argc, char **argv)
 
 static int psr_l3_cat_hwinfo(void)
 {
-    int rc, nr;
-    unsigned int i;
+    int rc;
+    unsigned int i, nr;
     uint32_t l3_cache_size;
     libxl_psr_cat_info *info;
 
@@ -424,7 +424,7 @@ static int psr_cat_print_socket(uint32_t domid, libxl_psr_cat_info *info,
 
 static int psr_cat_show(uint32_t domid, unsigned int lvl)
 {
-    int i, nr;
+    unsigned int i, nr;
     int rc;
     libxl_psr_cat_info *info;
 
@@ -453,8 +453,7 @@ out:
 static int psr_l2_cat_hwinfo(void)
 {
     int rc;
-    unsigned int i;
-    int nr;
+    unsigned int i, nr;
     libxl_psr_cat_info *info;
 
     rc = libxl_psr_cat_get_info(ctx, &info, &nr, 2);
-- 
1.9.1


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

  parent reply	other threads:[~2017-09-01  7:17 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-31  8:08 [PATCH 2/2] tools: remove unnecessary PSR macros Yi Sun
2017-08-31  9:07 ` Roger Pau Monné
2017-09-01  6:59 ` Yi Sun [this message]
2017-09-01  9:07   ` [PATCH] tools: change the type of '*nr' in 'libxl_psr_cat_get_info' Roger Pau Monné
2017-09-01 15:43   ` Wei Liu
2017-09-01 12:15 ` [PATCH v2] " Yi Sun
2017-09-01 14:33   ` Roger Pau Monné
2017-09-01 15:50   ` Wei Liu
2017-09-02 15:01     ` Yi Sun
2017-09-04  9:08   ` Wei Liu
2017-09-01 15:42 ` [PATCH 2/2] tools: remove unnecessary PSR macros Wei Liu
2017-09-04  3:25   ` Yi Sun
2017-09-04  3:08 ` [PATCH v2] " Yi Sun
2017-09-04  8:49   ` Wei Liu
2017-09-04  9:10     ` Yi Sun
2017-09-04  9:13       ` Wei Liu
2017-09-04  9:14     ` Roger Pau Monné

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1504249163-27185-1-git-send-email-yi.y.sun@linux.intel.com \
    --to=yi.y.sun@linux.intel.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=roger.pau@citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.