xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH for-4.6] libxl: don't shadow global "socket" in psr code
@ 2015-09-30 14:54 Wei Liu
  2015-09-30 15:29 ` Olaf Hering
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Liu @ 2015-09-30 14:54 UTC (permalink / raw)
  To: xen-devel; +Cc: Wei Liu, olaf, Ian Jackson, Ian Campbell, Chao Peng

SLES11 and OpenSUSE 11.4 complain:

[ 1227s] libxl_psr.c: In function 'libxl_psr_cat_get_l3_info':
[ 1227s] libxl_psr.c:342: error: declaration of 'socket' shadows a > global declaration

Change "socket" to "socketid" to fix the problem.

Reported-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Cc: Chao Peng <chao.p.peng@linux.intel.com>
---
 tools/libxl/libxl_psr.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/libxl/libxl_psr.c b/tools/libxl/libxl_psr.c
index 30740a1..000d748 100644
--- a/tools/libxl/libxl_psr.c
+++ b/tools/libxl/libxl_psr.c
@@ -339,7 +339,7 @@ int libxl_psr_cat_get_l3_info(libxl_ctx *ctx, libxl_psr_cat_info **info,
 {
     GC_INIT(ctx);
     int rc;
-    int i = 0, socket, nr_sockets;
+    int i = 0, socketid, nr_sockets;
     libxl_bitmap socketmap;
     libxl_psr_cat_info *ptr;
 
@@ -360,10 +360,10 @@ int libxl_psr_cat_get_l3_info(libxl_ctx *ctx, libxl_psr_cat_info **info,
 
     ptr = libxl__malloc(NOGC, nr_sockets * sizeof(libxl_psr_cat_info));
 
-    libxl_for_each_set_bit(socket, socketmap) {
-        ptr[i].id = socket;
-        if (xc_psr_cat_get_l3_info(ctx->xch, socket, &ptr[i].cos_max,
-                                                     &ptr[i].cbm_len)) {
+    libxl_for_each_set_bit(socketid, socketmap) {
+        ptr[i].id = socketid;
+        if (xc_psr_cat_get_l3_info(ctx->xch, socketid, &ptr[i].cos_max,
+                                   &ptr[i].cbm_len)) {
             libxl__psr_cat_log_err_msg(gc, errno);
             rc = ERROR_FAIL;
             free(ptr);
-- 
2.5.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH for-4.6] libxl: don't shadow global "socket" in psr code
  2015-09-30 14:54 [PATCH for-4.6] libxl: don't shadow global "socket" in psr code Wei Liu
@ 2015-09-30 15:29 ` Olaf Hering
  2015-09-30 16:05   ` Ian Campbell
  0 siblings, 1 reply; 3+ messages in thread
From: Olaf Hering @ 2015-09-30 15:29 UTC (permalink / raw)
  To: Wei Liu; +Cc: xen-devel, Ian Jackson, Ian Campbell, Chao Peng

On Wed, Sep 30, Wei Liu wrote:

> Change "socket" to "socketid" to fix the problem.

Tested-by: Olaf Hering <olaf@aepfle.de>

Olaf

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH for-4.6] libxl: don't shadow global "socket" in psr code
  2015-09-30 15:29 ` Olaf Hering
@ 2015-09-30 16:05   ` Ian Campbell
  0 siblings, 0 replies; 3+ messages in thread
From: Ian Campbell @ 2015-09-30 16:05 UTC (permalink / raw)
  To: Olaf Hering, Wei Liu; +Cc: xen-devel, Ian Jackson, Chao Peng

On Wed, 2015-09-30 at 17:29 +0200, Olaf Hering wrote:
> On Wed, Sep 30, Wei Liu wrote:
> 
> > Change "socket" to "socketid" to fix the problem.
> 
> Tested-by: Olaf Hering <olaf@aepfle.de>

acked + applied to staging and staging-4.6.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-09-30 16:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-30 14:54 [PATCH for-4.6] libxl: don't shadow global "socket" in psr code Wei Liu
2015-09-30 15:29 ` Olaf Hering
2015-09-30 16:05   ` Ian Campbell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).