All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix gcc-4.6's set-but-not-used warnings
@ 2011-08-25 14:20 Jan Beulich
  2011-08-25 14:39 ` Keir Fraser
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Beulich @ 2011-08-25 14:20 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 5619 bytes --]

Signed-off-by: Jan Beulich <jbeulich@novell.com>

--- a/xen/arch/x86/cpu/intel_cacheinfo.c
+++ b/xen/arch/x86/cpu/intel_cacheinfo.c
@@ -170,7 +170,6 @@ unsigned int __cpuinit init_intel_cachei
 	unsigned int trace = 0, l1i = 0, l1d = 0, l2 = 0, l3 = 0; /* Cache sizes */
 	unsigned int new_l1d = 0, new_l1i = 0; /* Cache sizes from cpuid(4) */
 	unsigned int new_l2 = 0, new_l3 = 0, i; /* Cache sizes from cpuid(4) */
-	unsigned int l2_id = 0, l3_id = 0, num_threads_sharing, index_msb;
 
 	if (c->cpuid_level > 3) {
 		static int is_initialized;
@@ -203,15 +202,9 @@ unsigned int __cpuinit init_intel_cachei
 					break;
 				    case 2:
 					new_l2 = this_leaf.size/1024;
-					num_threads_sharing = 1 + this_leaf.eax.split.num_threads_sharing;
-					index_msb = get_count_order(num_threads_sharing);
-					l2_id = c->apicid >> index_msb;
 					break;
 				    case 3:
 					new_l3 = this_leaf.size/1024;
-					num_threads_sharing = 1 + this_leaf.eax.split.num_threads_sharing;
-					index_msb = get_count_order(num_threads_sharing);
-					l3_id = c->apicid >> index_msb;
 					break;
 				    default:
 					break;
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -58,11 +58,10 @@ static int hvmemul_do_io(
     ioreq_t *p = get_ioreq(curr);
     unsigned long ram_gfn = paddr_to_pfn(ram_gpa);
     p2m_type_t p2mt;
-    mfn_t ram_mfn;
     int rc;
 
     /* Check for paged out page */
-    ram_mfn = gfn_to_mfn_unshare(curr->domain, ram_gfn, &p2mt);
+    gfn_to_mfn_unshare(curr->domain, ram_gfn, &p2mt);
     if ( p2m_is_paging(p2mt) )
     {
         p2m_mem_paging_populate(curr->domain, ram_gfn);
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3782,8 +3782,8 @@ long do_hvm_op(unsigned long op, XEN_GUE
         {
             p2m_type_t t;
             p2m_type_t nt;
-            mfn_t mfn;
-            mfn = gfn_to_mfn_unshare(d, pfn, &t);
+
+            gfn_to_mfn_unshare(d, pfn, &t);
             if ( p2m_is_paging(t) )
             {
                 p2m_mem_paging_populate(d, pfn);
--- a/xen/arch/x86/hvm/viridian.c
+++ b/xen/arch/x86/hvm/viridian.c
@@ -323,6 +323,9 @@ int viridian_hypercall(struct cpu_user_r
         status = HV_STATUS_SUCCESS;
         break;
     default:
+        /* Silence compiler warnings. */
+        (void)input_params_gpa;
+        (void)output_params_gpa;
         status = HV_STATUS_INVALID_HYPERCALL_CODE;
         break;
     }
--- a/xen/arch/x86/mm/p2m-pod.c
+++ b/xen/arch/x86/mm/p2m-pod.c
@@ -1078,7 +1078,6 @@ guest_physmap_mark_populate_on_demand(st
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
     unsigned long i;
     p2m_type_t ot;
-    mfn_t omfn;
     int pod_count = 0;
     int rc = 0;
 
@@ -1096,7 +1095,7 @@ guest_physmap_mark_populate_on_demand(st
     /* Make sure all gpfns are unused */
     for ( i = 0; i < (1UL << order); i++ )
     {
-        omfn = gfn_to_mfn_query(d, gfn + i, &ot);
+        gfn_to_mfn_query(d, gfn + i, &ot);
         if ( p2m_is_ram(ot) )
         {
             printk("%s: gfn_to_mfn returned type %d!\n",
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1012,8 +1012,7 @@ static void local_time_calibration(void)
      * System timestamps, extrapolated from local and master oscillators,
      * taken during this calibration and the previous calibration.
      */
-    s_time_t prev_local_stime, curr_local_stime;
-    s_time_t prev_master_stime, curr_master_stime;
+    s_time_t curr_local_stime, prev_master_stime, curr_master_stime;
 
     /* TSC timestamps taken during this calibration and prev calibration. */
     u64 prev_tsc, curr_tsc;
@@ -1050,7 +1049,6 @@ static void local_time_calibration(void)
     }
 
     prev_tsc          = t->local_tsc_stamp;
-    prev_local_stime  = t->stime_local_stamp;
     prev_master_stime = t->stime_master_stamp;
 
     /* Disabling IRQs ensures we atomically read cpu_calibration struct. */
@@ -1062,7 +1060,7 @@ static void local_time_calibration(void)
 
 #if 0
     printk("PRE%d: tsc=%"PRIu64" stime=%"PRIu64" master=%"PRIu64"\n",
-           smp_processor_id(), prev_tsc, prev_local_stime, prev_master_stime);
+           smp_processor_id(), prev_tsc, t->stime_local_stamp, prev_master_stime);
     printk("CUR%d: tsc=%"PRIu64" stime=%"PRIu64" master=%"PRIu64
            " -> %"PRId64"\n",
            smp_processor_id(), curr_tsc, curr_local_stime, curr_master_stime,
--- a/xen/common/cpupool.c
+++ b/xen/common/cpupool.c
@@ -35,7 +35,7 @@ static DEFINE_SPINLOCK(cpupool_lock);
 
 DEFINE_PER_CPU(struct cpupool *, cpupool);
 
-#define cpupool_dprintk(x...) ((void)0)
+static inline void cpupool_dprintk(const char *fmt, ...) { }
 
 static struct cpupool *alloc_cpupool_struct(void)
 {
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -594,7 +594,7 @@ static int kexec_exec(XEN_GUEST_HANDLE(v
         break;
     }
 
-    return -EINVAL; /* never reached */
+    return ret; /* never reached */
 }
 
 int do_kexec_op_internal(unsigned long op, XEN_GUEST_HANDLE(void) uarg,
--- a/xen/common/unlzo.c
+++ b/xen/common/unlzo.c
@@ -68,7 +68,6 @@ static int INIT parse_header(u8 *input, 
 {
 	int l;
 	u8 *parse = input;
-	u8 level = 0;
 	u16 version;
 
 	/* read magic: 9 first bits */
@@ -82,7 +81,7 @@ static int INIT parse_header(u8 *input, 
 	version = get_unaligned_be16(parse);
 	parse += 7;
 	if (version >= 0x0940)
-		level = *parse++;
+		parse++;
 	if (get_unaligned_be32(parse) & HEADER_HAS_FILTER)
 		parse += 8; /* flags + filter info */
 	else



[-- Attachment #2: gcc-4.6-set-but-not-used.patch --]
[-- Type: text/plain, Size: 5615 bytes --]

Signed-off-by: Jan Beulich <jbeulich@novell.com>

--- a/xen/arch/x86/cpu/intel_cacheinfo.c
+++ b/xen/arch/x86/cpu/intel_cacheinfo.c
@@ -170,7 +170,6 @@ unsigned int __cpuinit init_intel_cachei
 	unsigned int trace = 0, l1i = 0, l1d = 0, l2 = 0, l3 = 0; /* Cache sizes */
 	unsigned int new_l1d = 0, new_l1i = 0; /* Cache sizes from cpuid(4) */
 	unsigned int new_l2 = 0, new_l3 = 0, i; /* Cache sizes from cpuid(4) */
-	unsigned int l2_id = 0, l3_id = 0, num_threads_sharing, index_msb;
 
 	if (c->cpuid_level > 3) {
 		static int is_initialized;
@@ -203,15 +202,9 @@ unsigned int __cpuinit init_intel_cachei
 					break;
 				    case 2:
 					new_l2 = this_leaf.size/1024;
-					num_threads_sharing = 1 + this_leaf.eax.split.num_threads_sharing;
-					index_msb = get_count_order(num_threads_sharing);
-					l2_id = c->apicid >> index_msb;
 					break;
 				    case 3:
 					new_l3 = this_leaf.size/1024;
-					num_threads_sharing = 1 + this_leaf.eax.split.num_threads_sharing;
-					index_msb = get_count_order(num_threads_sharing);
-					l3_id = c->apicid >> index_msb;
 					break;
 				    default:
 					break;
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -58,11 +58,10 @@ static int hvmemul_do_io(
     ioreq_t *p = get_ioreq(curr);
     unsigned long ram_gfn = paddr_to_pfn(ram_gpa);
     p2m_type_t p2mt;
-    mfn_t ram_mfn;
     int rc;
 
     /* Check for paged out page */
-    ram_mfn = gfn_to_mfn_unshare(curr->domain, ram_gfn, &p2mt);
+    gfn_to_mfn_unshare(curr->domain, ram_gfn, &p2mt);
     if ( p2m_is_paging(p2mt) )
     {
         p2m_mem_paging_populate(curr->domain, ram_gfn);
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3782,8 +3782,8 @@ long do_hvm_op(unsigned long op, XEN_GUE
         {
             p2m_type_t t;
             p2m_type_t nt;
-            mfn_t mfn;
-            mfn = gfn_to_mfn_unshare(d, pfn, &t);
+
+            gfn_to_mfn_unshare(d, pfn, &t);
             if ( p2m_is_paging(t) )
             {
                 p2m_mem_paging_populate(d, pfn);
--- a/xen/arch/x86/hvm/viridian.c
+++ b/xen/arch/x86/hvm/viridian.c
@@ -323,6 +323,9 @@ int viridian_hypercall(struct cpu_user_r
         status = HV_STATUS_SUCCESS;
         break;
     default:
+        /* Silence compiler warnings. */
+        (void)input_params_gpa;
+        (void)output_params_gpa;
         status = HV_STATUS_INVALID_HYPERCALL_CODE;
         break;
     }
--- a/xen/arch/x86/mm/p2m-pod.c
+++ b/xen/arch/x86/mm/p2m-pod.c
@@ -1078,7 +1078,6 @@ guest_physmap_mark_populate_on_demand(st
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
     unsigned long i;
     p2m_type_t ot;
-    mfn_t omfn;
     int pod_count = 0;
     int rc = 0;
 
@@ -1096,7 +1095,7 @@ guest_physmap_mark_populate_on_demand(st
     /* Make sure all gpfns are unused */
     for ( i = 0; i < (1UL << order); i++ )
     {
-        omfn = gfn_to_mfn_query(d, gfn + i, &ot);
+        gfn_to_mfn_query(d, gfn + i, &ot);
         if ( p2m_is_ram(ot) )
         {
             printk("%s: gfn_to_mfn returned type %d!\n",
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1012,8 +1012,7 @@ static void local_time_calibration(void)
      * System timestamps, extrapolated from local and master oscillators,
      * taken during this calibration and the previous calibration.
      */
-    s_time_t prev_local_stime, curr_local_stime;
-    s_time_t prev_master_stime, curr_master_stime;
+    s_time_t curr_local_stime, prev_master_stime, curr_master_stime;
 
     /* TSC timestamps taken during this calibration and prev calibration. */
     u64 prev_tsc, curr_tsc;
@@ -1050,7 +1049,6 @@ static void local_time_calibration(void)
     }
 
     prev_tsc          = t->local_tsc_stamp;
-    prev_local_stime  = t->stime_local_stamp;
     prev_master_stime = t->stime_master_stamp;
 
     /* Disabling IRQs ensures we atomically read cpu_calibration struct. */
@@ -1062,7 +1060,7 @@ static void local_time_calibration(void)
 
 #if 0
     printk("PRE%d: tsc=%"PRIu64" stime=%"PRIu64" master=%"PRIu64"\n",
-           smp_processor_id(), prev_tsc, prev_local_stime, prev_master_stime);
+           smp_processor_id(), prev_tsc, t->stime_local_stamp, prev_master_stime);
     printk("CUR%d: tsc=%"PRIu64" stime=%"PRIu64" master=%"PRIu64
            " -> %"PRId64"\n",
            smp_processor_id(), curr_tsc, curr_local_stime, curr_master_stime,
--- a/xen/common/cpupool.c
+++ b/xen/common/cpupool.c
@@ -35,7 +35,7 @@ static DEFINE_SPINLOCK(cpupool_lock);
 
 DEFINE_PER_CPU(struct cpupool *, cpupool);
 
-#define cpupool_dprintk(x...) ((void)0)
+static inline void cpupool_dprintk(const char *fmt, ...) { }
 
 static struct cpupool *alloc_cpupool_struct(void)
 {
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -594,7 +594,7 @@ static int kexec_exec(XEN_GUEST_HANDLE(v
         break;
     }
 
-    return -EINVAL; /* never reached */
+    return ret; /* never reached */
 }
 
 int do_kexec_op_internal(unsigned long op, XEN_GUEST_HANDLE(void) uarg,
--- a/xen/common/unlzo.c
+++ b/xen/common/unlzo.c
@@ -68,7 +68,6 @@ static int INIT parse_header(u8 *input, 
 {
 	int l;
 	u8 *parse = input;
-	u8 level = 0;
 	u16 version;
 
 	/* read magic: 9 first bits */
@@ -82,7 +81,7 @@ static int INIT parse_header(u8 *input, 
 	version = get_unaligned_be16(parse);
 	parse += 7;
 	if (version >= 0x0940)
-		level = *parse++;
+		parse++;
 	if (get_unaligned_be32(parse) & HEADER_HAS_FILTER)
 		parse += 8; /* flags + filter info */
 	else

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

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

* Re: [PATCH] fix gcc-4.6's set-but-not-used warnings
  2011-08-25 14:20 [PATCH] fix gcc-4.6's set-but-not-used warnings Jan Beulich
@ 2011-08-25 14:39 ` Keir Fraser
  2011-08-25 15:08   ` Jan Beulich
  2011-08-25 15:43   ` Jan Beulich
  0 siblings, 2 replies; 5+ messages in thread
From: Keir Fraser @ 2011-08-25 14:39 UTC (permalink / raw)
  To: Jan Beulich, xen-devel

On 25/08/2011 15:20, "Jan Beulich" <JBeulich@novell.com> wrote:

> Signed-off-by: Jan Beulich <jbeulich@novell.com>

But we compile with -Wno-unused-but-set-variable?

> --- a/xen/arch/x86/cpu/intel_cacheinfo.c
> +++ b/xen/arch/x86/cpu/intel_cacheinfo.c
> @@ -170,7 +170,6 @@ unsigned int __cpuinit init_intel_cachei
> unsigned int trace = 0, l1i = 0, l1d = 0, l2 = 0, l3 = 0; /* Cache sizes */
> unsigned int new_l1d = 0, new_l1i = 0; /* Cache sizes from cpuid(4) */
> unsigned int new_l2 = 0, new_l3 = 0, i; /* Cache sizes from cpuid(4) */
> - unsigned int l2_id = 0, l3_id = 0, num_threads_sharing, index_msb;
>  
> if (c->cpuid_level > 3) {
> static int is_initialized;
> @@ -203,15 +202,9 @@ unsigned int __cpuinit init_intel_cachei
> break;
>    case 2:
> new_l2 = this_leaf.size/1024;
> -     num_threads_sharing = 1 + this_leaf.eax.split.num_threads_sharing;
> -     index_msb = get_count_order(num_threads_sharing);
> -     l2_id = c->apicid >> index_msb;
> break;
>    case 3:
> new_l3 = this_leaf.size/1024;
> -     num_threads_sharing = 1 + this_leaf.eax.split.num_threads_sharing;
> -     index_msb = get_count_order(num_threads_sharing);
> -     l3_id = c->apicid >> index_msb;
> break;
>    default:
> break;
> --- a/xen/arch/x86/hvm/emulate.c
> +++ b/xen/arch/x86/hvm/emulate.c
> @@ -58,11 +58,10 @@ static int hvmemul_do_io(
>      ioreq_t *p = get_ioreq(curr);
>      unsigned long ram_gfn = paddr_to_pfn(ram_gpa);
>      p2m_type_t p2mt;
> -    mfn_t ram_mfn;
>      int rc;
>  
>      /* Check for paged out page */
> -    ram_mfn = gfn_to_mfn_unshare(curr->domain, ram_gfn, &p2mt);
> +    gfn_to_mfn_unshare(curr->domain, ram_gfn, &p2mt);
>      if ( p2m_is_paging(p2mt) )
>      {
>          p2m_mem_paging_populate(curr->domain, ram_gfn);
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -3782,8 +3782,8 @@ long do_hvm_op(unsigned long op, XEN_GUE
>          {
>              p2m_type_t t;
>              p2m_type_t nt;
> -            mfn_t mfn;
> -            mfn = gfn_to_mfn_unshare(d, pfn, &t);
> +
> +            gfn_to_mfn_unshare(d, pfn, &t);
>              if ( p2m_is_paging(t) )
>              {
>                  p2m_mem_paging_populate(d, pfn);
> --- a/xen/arch/x86/hvm/viridian.c
> +++ b/xen/arch/x86/hvm/viridian.c
> @@ -323,6 +323,9 @@ int viridian_hypercall(struct cpu_user_r
>          status = HV_STATUS_SUCCESS;
>          break;
>      default:
> +        /* Silence compiler warnings. */
> +        (void)input_params_gpa;
> +        (void)output_params_gpa;
>          status = HV_STATUS_INVALID_HYPERCALL_CODE;
>          break;
>      }
> --- a/xen/arch/x86/mm/p2m-pod.c
> +++ b/xen/arch/x86/mm/p2m-pod.c
> @@ -1078,7 +1078,6 @@ guest_physmap_mark_populate_on_demand(st
>      struct p2m_domain *p2m = p2m_get_hostp2m(d);
>      unsigned long i;
>      p2m_type_t ot;
> -    mfn_t omfn;
>      int pod_count = 0;
>      int rc = 0;
>  
> @@ -1096,7 +1095,7 @@ guest_physmap_mark_populate_on_demand(st
>      /* Make sure all gpfns are unused */
>      for ( i = 0; i < (1UL << order); i++ )
>      {
> -        omfn = gfn_to_mfn_query(d, gfn + i, &ot);
> +        gfn_to_mfn_query(d, gfn + i, &ot);
>          if ( p2m_is_ram(ot) )
>          {
>              printk("%s: gfn_to_mfn returned type %d!\n",
> --- a/xen/arch/x86/time.c
> +++ b/xen/arch/x86/time.c
> @@ -1012,8 +1012,7 @@ static void local_time_calibration(void)
>       * System timestamps, extrapolated from local and master oscillators,
>       * taken during this calibration and the previous calibration.
>       */
> -    s_time_t prev_local_stime, curr_local_stime;
> -    s_time_t prev_master_stime, curr_master_stime;
> +    s_time_t curr_local_stime, prev_master_stime, curr_master_stime;
>  
>      /* TSC timestamps taken during this calibration and prev calibration. */
>      u64 prev_tsc, curr_tsc;
> @@ -1050,7 +1049,6 @@ static void local_time_calibration(void)
>      }
>  
>      prev_tsc          = t->local_tsc_stamp;
> -    prev_local_stime  = t->stime_local_stamp;
>      prev_master_stime = t->stime_master_stamp;
>  
>      /* Disabling IRQs ensures we atomically read cpu_calibration struct. */
> @@ -1062,7 +1060,7 @@ static void local_time_calibration(void)
>  
>  #if 0
>      printk("PRE%d: tsc=%"PRIu64" stime=%"PRIu64" master=%"PRIu64"\n",
> -           smp_processor_id(), prev_tsc, prev_local_stime,
> prev_master_stime);
> +           smp_processor_id(), prev_tsc, t->stime_local_stamp,
> prev_master_stime);
>      printk("CUR%d: tsc=%"PRIu64" stime=%"PRIu64" master=%"PRIu64
>             " -> %"PRId64"\n",
>             smp_processor_id(), curr_tsc, curr_local_stime, curr_master_stime,
> --- a/xen/common/cpupool.c
> +++ b/xen/common/cpupool.c
> @@ -35,7 +35,7 @@ static DEFINE_SPINLOCK(cpupool_lock);
>  
>  DEFINE_PER_CPU(struct cpupool *, cpupool);
>  
> -#define cpupool_dprintk(x...) ((void)0)
> +static inline void cpupool_dprintk(const char *fmt, ...) { }
>  
>  static struct cpupool *alloc_cpupool_struct(void)
>  {
> --- a/xen/common/kexec.c
> +++ b/xen/common/kexec.c
> @@ -594,7 +594,7 @@ static int kexec_exec(XEN_GUEST_HANDLE(v
>          break;
>      }
>  
> -    return -EINVAL; /* never reached */
> +    return ret; /* never reached */
>  }
>  
>  int do_kexec_op_internal(unsigned long op, XEN_GUEST_HANDLE(void) uarg,
> --- a/xen/common/unlzo.c
> +++ b/xen/common/unlzo.c
> @@ -68,7 +68,6 @@ static int INIT parse_header(u8 *input,
>  {
> int l;
> u8 *parse = input;
> - u8 level = 0;
> u16 version;
>  
> /* read magic: 9 first bits */
> @@ -82,7 +81,7 @@ static int INIT parse_header(u8 *input,
> version = get_unaligned_be16(parse);
> parse += 7;
> if (version >= 0x0940)
> -  level = *parse++;
> +  parse++;
> if (get_unaligned_be32(parse) & HEADER_HAS_FILTER)
> parse += 8; /* flags + filter info */
> else
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

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

* Re: [PATCH] fix gcc-4.6's set-but-not-used warnings
  2011-08-25 14:39 ` Keir Fraser
@ 2011-08-25 15:08   ` Jan Beulich
  2011-08-25 15:43   ` Jan Beulich
  1 sibling, 0 replies; 5+ messages in thread
From: Jan Beulich @ 2011-08-25 15:08 UTC (permalink / raw)
  To: Keir Fraser; +Cc: xen-devel

>>> On 25.08.11 at 16:39, Keir Fraser <keir.xen@gmail.com> wrote:
> On 25/08/2011 15:20, "Jan Beulich" <JBeulich@novell.com> wrote:
> 
>> Signed-off-by: Jan Beulich <jbeulich@novell.com>
> 
> But we compile with -Wno-unused-but-set-variable?

Hmm, now that you say it I recall that was meant to be the case. But it
isn't in my cross-build environment, and hence I'm seeing the errors now
that I switched to 4.6.1. Let me check what goes wrong with the feature
detection (as I'll be out of the office tomorrow and al of next week, that'll
likely be only in the second week of September then).

Jan

>> --- a/xen/arch/x86/cpu/intel_cacheinfo.c
>> +++ b/xen/arch/x86/cpu/intel_cacheinfo.c
>> @@ -170,7 +170,6 @@ unsigned int __cpuinit init_intel_cachei
>> unsigned int trace = 0, l1i = 0, l1d = 0, l2 = 0, l3 = 0; /* Cache sizes */
>> unsigned int new_l1d = 0, new_l1i = 0; /* Cache sizes from cpuid(4) */
>> unsigned int new_l2 = 0, new_l3 = 0, i; /* Cache sizes from cpuid(4) */
>> - unsigned int l2_id = 0, l3_id = 0, num_threads_sharing, index_msb;
>>  
>> if (c->cpuid_level > 3) {
>> static int is_initialized;
>> @@ -203,15 +202,9 @@ unsigned int __cpuinit init_intel_cachei
>> break;
>>    case 2:
>> new_l2 = this_leaf.size/1024;
>> -     num_threads_sharing = 1 + this_leaf.eax.split.num_threads_sharing;
>> -     index_msb = get_count_order(num_threads_sharing);
>> -     l2_id = c->apicid >> index_msb;
>> break;
>>    case 3:
>> new_l3 = this_leaf.size/1024;
>> -     num_threads_sharing = 1 + this_leaf.eax.split.num_threads_sharing;
>> -     index_msb = get_count_order(num_threads_sharing);
>> -     l3_id = c->apicid >> index_msb;
>> break;
>>    default:
>> break;
>> --- a/xen/arch/x86/hvm/emulate.c
>> +++ b/xen/arch/x86/hvm/emulate.c
>> @@ -58,11 +58,10 @@ static int hvmemul_do_io(
>>      ioreq_t *p = get_ioreq(curr);
>>      unsigned long ram_gfn = paddr_to_pfn(ram_gpa);
>>      p2m_type_t p2mt;
>> -    mfn_t ram_mfn;
>>      int rc;
>>  
>>      /* Check for paged out page */
>> -    ram_mfn = gfn_to_mfn_unshare(curr->domain, ram_gfn, &p2mt);
>> +    gfn_to_mfn_unshare(curr->domain, ram_gfn, &p2mt);
>>      if ( p2m_is_paging(p2mt) )
>>      {
>>          p2m_mem_paging_populate(curr->domain, ram_gfn);
>> --- a/xen/arch/x86/hvm/hvm.c
>> +++ b/xen/arch/x86/hvm/hvm.c
>> @@ -3782,8 +3782,8 @@ long do_hvm_op(unsigned long op, XEN_GUE
>>          {
>>              p2m_type_t t;
>>              p2m_type_t nt;
>> -            mfn_t mfn;
>> -            mfn = gfn_to_mfn_unshare(d, pfn, &t);
>> +
>> +            gfn_to_mfn_unshare(d, pfn, &t);
>>              if ( p2m_is_paging(t) )
>>              {
>>                  p2m_mem_paging_populate(d, pfn);
>> --- a/xen/arch/x86/hvm/viridian.c
>> +++ b/xen/arch/x86/hvm/viridian.c
>> @@ -323,6 +323,9 @@ int viridian_hypercall(struct cpu_user_r
>>          status = HV_STATUS_SUCCESS;
>>          break;
>>      default:
>> +        /* Silence compiler warnings. */
>> +        (void)input_params_gpa;
>> +        (void)output_params_gpa;
>>          status = HV_STATUS_INVALID_HYPERCALL_CODE;
>>          break;
>>      }
>> --- a/xen/arch/x86/mm/p2m-pod.c
>> +++ b/xen/arch/x86/mm/p2m-pod.c
>> @@ -1078,7 +1078,6 @@ guest_physmap_mark_populate_on_demand(st
>>      struct p2m_domain *p2m = p2m_get_hostp2m(d);
>>      unsigned long i;
>>      p2m_type_t ot;
>> -    mfn_t omfn;
>>      int pod_count = 0;
>>      int rc = 0;
>>  
>> @@ -1096,7 +1095,7 @@ guest_physmap_mark_populate_on_demand(st
>>      /* Make sure all gpfns are unused */
>>      for ( i = 0; i < (1UL << order); i++ )
>>      {
>> -        omfn = gfn_to_mfn_query(d, gfn + i, &ot);
>> +        gfn_to_mfn_query(d, gfn + i, &ot);
>>          if ( p2m_is_ram(ot) )
>>          {
>>              printk("%s: gfn_to_mfn returned type %d!\n",
>> --- a/xen/arch/x86/time.c
>> +++ b/xen/arch/x86/time.c
>> @@ -1012,8 +1012,7 @@ static void local_time_calibration(void)
>>       * System timestamps, extrapolated from local and master oscillators,
>>       * taken during this calibration and the previous calibration.
>>       */
>> -    s_time_t prev_local_stime, curr_local_stime;
>> -    s_time_t prev_master_stime, curr_master_stime;
>> +    s_time_t curr_local_stime, prev_master_stime, curr_master_stime;
>>  
>>      /* TSC timestamps taken during this calibration and prev calibration. 
> */
>>      u64 prev_tsc, curr_tsc;
>> @@ -1050,7 +1049,6 @@ static void local_time_calibration(void)
>>      }
>>  
>>      prev_tsc          = t->local_tsc_stamp;
>> -    prev_local_stime  = t->stime_local_stamp;
>>      prev_master_stime = t->stime_master_stamp;
>>  
>>      /* Disabling IRQs ensures we atomically read cpu_calibration struct. */
>> @@ -1062,7 +1060,7 @@ static void local_time_calibration(void)
>>  
>>  #if 0
>>      printk("PRE%d: tsc=%"PRIu64" stime=%"PRIu64" master=%"PRIu64"\n",
>> -           smp_processor_id(), prev_tsc, prev_local_stime,
>> prev_master_stime);
>> +           smp_processor_id(), prev_tsc, t->stime_local_stamp,
>> prev_master_stime);
>>      printk("CUR%d: tsc=%"PRIu64" stime=%"PRIu64" master=%"PRIu64
>>             " -> %"PRId64"\n",
>>             smp_processor_id(), curr_tsc, curr_local_stime, 
> curr_master_stime,
>> --- a/xen/common/cpupool.c
>> +++ b/xen/common/cpupool.c
>> @@ -35,7 +35,7 @@ static DEFINE_SPINLOCK(cpupool_lock);
>>  
>>  DEFINE_PER_CPU(struct cpupool *, cpupool);
>>  
>> -#define cpupool_dprintk(x...) ((void)0)
>> +static inline void cpupool_dprintk(const char *fmt, ...) { }
>>  
>>  static struct cpupool *alloc_cpupool_struct(void)
>>  {
>> --- a/xen/common/kexec.c
>> +++ b/xen/common/kexec.c
>> @@ -594,7 +594,7 @@ static int kexec_exec(XEN_GUEST_HANDLE(v
>>          break;
>>      }
>>  
>> -    return -EINVAL; /* never reached */
>> +    return ret; /* never reached */
>>  }
>>  
>>  int do_kexec_op_internal(unsigned long op, XEN_GUEST_HANDLE(void) uarg,
>> --- a/xen/common/unlzo.c
>> +++ b/xen/common/unlzo.c
>> @@ -68,7 +68,6 @@ static int INIT parse_header(u8 *input,
>>  {
>> int l;
>> u8 *parse = input;
>> - u8 level = 0;
>> u16 version;
>>  
>> /* read magic: 9 first bits */
>> @@ -82,7 +81,7 @@ static int INIT parse_header(u8 *input,
>> version = get_unaligned_be16(parse);
>> parse += 7;
>> if (version >= 0x0940)
>> -  level = *parse++;
>> +  parse++;
>> if (get_unaligned_be32(parse) & HEADER_HAS_FILTER)
>> parse += 8; /* flags + filter info */
>> else
>> 
>> 
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xensource.com 
>> http://lists.xensource.com/xen-devel 

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

* Re: [PATCH] fix gcc-4.6's set-but-not-used warnings
  2011-08-25 14:39 ` Keir Fraser
  2011-08-25 15:08   ` Jan Beulich
@ 2011-08-25 15:43   ` Jan Beulich
  2011-08-25 16:27     ` Keir Fraser
  1 sibling, 1 reply; 5+ messages in thread
From: Jan Beulich @ 2011-08-25 15:43 UTC (permalink / raw)
  To: Keir Fraser; +Cc: xen-devel

>>> On 25.08.11 at 16:39, Keir Fraser <keir.xen@gmail.com> wrote:
> On 25/08/2011 15:20, "Jan Beulich" <JBeulich@novell.com> wrote:
> 
>> Signed-off-by: Jan Beulich <jbeulich@novell.com>
> 
> But we compile with -Wno-unused-but-set-variable?

My problem seems to be related to me setting the cross-compiler
override in ./.config, but that file gets included only after the first set
of cc-option-add invocations already happened. Unless there's another
way of setting the cross-compile override persistently (i.e. not on the
make command line), would it be possible to move those invocations
down (which works for me)?

Jan

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

* Re: [PATCH] fix gcc-4.6's set-but-not-used warnings
  2011-08-25 15:43   ` Jan Beulich
@ 2011-08-25 16:27     ` Keir Fraser
  0 siblings, 0 replies; 5+ messages in thread
From: Keir Fraser @ 2011-08-25 16:27 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel

On 25/08/2011 16:43, "Jan Beulich" <JBeulich@suse.com> wrote:

>>>> On 25.08.11 at 16:39, Keir Fraser <keir.xen@gmail.com> wrote:
>> On 25/08/2011 15:20, "Jan Beulich" <JBeulich@novell.com> wrote:
>> 
>>> Signed-off-by: Jan Beulich <jbeulich@novell.com>
>> 
>> But we compile with -Wno-unused-but-set-variable?
> 
> My problem seems to be related to me setting the cross-compiler
> override in ./.config, but that file gets included only after the first set
> of cc-option-add invocations already happened. Unless there's another
> way of setting the cross-compile override persistently (i.e. not on the
> make command line), would it be possible to move those invocations
> down (which works for me)?

Move the cc-option-add invocations right to the very bottom of Config.mk?
Makes sense to me. I'll make that change.

 -- Keir

> Jan
> 

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

end of thread, other threads:[~2011-08-25 16:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-25 14:20 [PATCH] fix gcc-4.6's set-but-not-used warnings Jan Beulich
2011-08-25 14:39 ` Keir Fraser
2011-08-25 15:08   ` Jan Beulich
2011-08-25 15:43   ` Jan Beulich
2011-08-25 16:27     ` Keir Fraser

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.