From: "Jan Beulich" Subject: [PATCH] remove the use of -Wno-unused-value Date: Mon, 12 Dec 2011 15:43:00 +0000 Message-ID: <4EE62F140200007800067003@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartF5DA5014.0__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__PartF5DA5014.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline It has been hiding actual mistakes, and there are not too many changes necessary to make things build without suppressing this warning. Signed-off-by: Jan Beulich --- 2011-12-12.orig/Config.mk 2011-12-12 15:46:14.000000000 +0100 +++ 2011-12-12/Config.mk 2011-11-30 17:49:42.000000000 +0100 @@ -157,10 +157,6 @@ CFLAGS +=3D -std=3Dgnu99 =20 CFLAGS +=3D -Wall -Wstrict-prototypes =20 -# -Wunused-value makes GCC 4.x too aggressive for my taste: ignoring the -# result of any casted expression causes a warning. -CFLAGS +=3D -Wno-unused-value - # Clang complains about macros that expand to 'if ( ( foo =3D=3D bar ) ) = ...' # and is over-zealous with the printf format lint CFLAGS-$(clang) +=3D -Wno-parentheses -Wno-format --- 2011-12-12.orig/tools/libfsimage/common/fsimage_grub.h 2010-04-19 = 09:12:58.000000000 +0200 +++ 2011-12-12/tools/libfsimage/common/fsimage_grub.h 2011-12-12 = 15:47:35.000000000 +0100 @@ -57,7 +57,7 @@ typedef struct fsig_plugin_ops { #define disk_read_func (*fsig_disk_read_junk()) #define disk_read_hook (*fsig_disk_read_junk()) #define print_possibilities 0 -#define noisy_printf +#define noisy_printf(fmt...) =20 #define grub_memset memset #define grub_memmove memmove --- 2011-12-12.orig/xen/arch/x86/debug.c 2011-12-12 15:46:14.0000000= 00 +0100 +++ 2011-12-12/xen/arch/x86/debug.c 2011-11-30 17:50:55.000000000 = +0100 @@ -37,8 +37,8 @@ #define DBGP1(...) {(kdbdbg>1) ? kdbp(__VA_ARGS__):0;} #define DBGP2(...) {(kdbdbg>2) ? kdbp(__VA_ARGS__):0;} #else -#define DBGP1(...) {0;} -#define DBGP2(...) {0;} +#define DBGP1(...) ((void)0) +#define DBGP2(...) ((void)0) #endif =20 /* Returns: mfn for the given (hvm guest) vaddr */ --- 2011-12-12.orig/xen/arch/x86/hvm/svm/vpmu.c 2011-12-12 15:46:14.0000000= 00 +0100 +++ 2011-12-12/xen/arch/x86/hvm/svm/vpmu.c 2011-12-01 11:35:58.0000000= 00 +0100 @@ -154,7 +154,7 @@ static int amd_vpmu_do_interrupt(struct=20 if ( GET_APIC_DELIVERY_MODE(vlapic_lvtpc) =3D=3D APIC_MODE_FIXED ) vlapic_set_irq(vcpu_vlapic(v), int_vec, 0); else - test_and_set_bool(v->nmi_pending); + v->nmi_pending =3D 1; =20 return 1; } --- 2011-12-12.orig/xen/arch/x86/hvm/vmx/vpmu_core2.c 2011-12-12 = 15:46:14.000000000 +0100 +++ 2011-12-12/xen/arch/x86/hvm/vmx/vpmu_core2.c 2011-12-01 = 11:36:37.000000000 +0100 @@ -574,7 +574,7 @@ static int core2_vpmu_do_interrupt(struc if ( GET_APIC_DELIVERY_MODE(vlapic_lvtpc) =3D=3D APIC_MODE_FIXED ) vlapic_set_irq(vcpu_vlapic(v), int_vec, 0); else - test_and_set_bool(v->nmi_pending); + v->nmi_pending =3D 1; return 1; } =20 --- 2011-12-12.orig/xen/arch/x86/oprofile/nmi_int.c 2011-12-12 = 15:46:14.000000000 +0100 +++ 2011-12-12/xen/arch/x86/oprofile/nmi_int.c 2011-11-30 18:01:11.0000000= 00 +0100 @@ -92,7 +92,7 @@ static int nmi_callback(struct cpu_user_ send_guest_vcpu_virq(current, VIRQ_XENOPROF); =20 if ( ovf =3D=3D 2 )=20 - test_and_set_bool(current->nmi_pending); + current->nmi_pending =3D 1; return 1; } =20 --- 2011-12-12.orig/xen/include/asm-x86/debugger.h 2011-12-12 = 15:46:14.000000000 +0100 +++ 2011-12-12/xen/include/asm-x86/debugger.h 2011-11-30 17:58:20.0000000= 00 +0100 @@ -55,7 +55,12 @@ static inline int debugger_trap_fatal( =20 #else =20 -#define debugger_trap_fatal(v, r) (0) +static inline int debugger_trap_fatal( + unsigned int vector, struct cpu_user_regs *regs) +{ + return 0; +} + #define debugger_trap_immediate() ((void)0) =20 #endif --- 2011-12-12.orig/xen/include/asm-x86/hvm/hvm.h 2011-12-12 = 15:46:14.000000000 +0100 +++ 2011-12-12/xen/include/asm-x86/hvm/hvm.h 2011-12-01 12:15:02.0000000= 00 +0100 @@ -235,7 +235,7 @@ int hvm_girq_dest_2_vcpu_id(struct domai #define hvm_long_mode_enabled(v) \ ((v)->arch.hvm_vcpu.guest_efer & EFER_LMA) #else -#define hvm_long_mode_enabled(v) (v,0) +#define hvm_long_mode_enabled(v) ((void)(v),0) #endif =20 enum hvm_intblk --- 2011-12-12.orig/xen/include/xen/tmem_xen.h 2011-12-12 15:46:14.0000000= 00 +0100 +++ 2011-12-12/xen/include/xen/tmem_xen.h 2011-11-30 17:55:22.0000000= 00 +0100 @@ -365,7 +365,7 @@ static inline int tmh_page_cmp(pfp_t *pf // FIXME: code in assembly? ASSERT(p1 !=3D NULL); ASSERT(p2 !=3D NULL); - for ( i =3D PAGE_SIZE/sizeof(uint64_t); i && *p1 =3D=3D *p2; i--, = *p1++, *p2++ ); + for ( i =3D PAGE_SIZE/sizeof(uint64_t); i && *p1 =3D=3D *p2; i--, = p1++, p2++ ); if ( !i ) return 0; if ( *p1 < *p2 ) @@ -386,7 +386,7 @@ static inline int tmh_pcd_cmp(void *va1, if ( len1 > len2 ) return 1; ASSERT(len1 =3D=3D len2); - for ( i =3D len2; i && *p1 =3D=3D *p2; i--, *p1++, *p2++ ); + for ( i =3D len2; i && *p1 =3D=3D *p2; i--, p1++, p2++ ); if ( !i ) return 0; if ( *p1 < *p2 ) @@ -413,7 +413,7 @@ static inline int tmh_tze_pfp_cmp(pfp_t=20 if ( pfp_len > tze_len ) return 1; ASSERT(pfp_len =3D=3D tze_len); - for ( i =3D tze_len/sizeof(uint64_t); i && *p1 =3D=3D *p2; i--, = *p1++, *p2++ ); + for ( i =3D tze_len/sizeof(uint64_t); i && *p1 =3D=3D *p2; i--, p1++, = p2++ ); if ( !i ) return 0; if ( *p1 < *p2 ) --- 2011-12-12.orig/xen/include/xsm/xsm.h 2011-12-12 15:46:14.0000000= 00 +0100 +++ 2011-12-12/xen/include/xsm/xsm.h 2011-12-12 15:23:49.000000000 = +0100 @@ -163,7 +163,7 @@ extern struct xsm_operations *xsm_ops; static inline void xsm_security_domaininfo (struct domain *d, struct xen_domctl_getdomaininfo = *info) { - xsm_call(security_domaininfo(d, info)); + (void)xsm_call(security_domaininfo(d, info)); } =20 static inline int xsm_setvcpucontext(struct domain *d) @@ -310,7 +310,7 @@ static inline int xsm_evtchn_interdomain =20 static inline void xsm_evtchn_close_post (struct evtchn *chn) { - xsm_call(evtchn_close_post(chn)); + (void)xsm_call(evtchn_close_post(chn)); } =20 static inline int xsm_evtchn_send (struct domain *d, struct evtchn *chn) @@ -366,7 +366,7 @@ static inline int xsm_alloc_security_dom =20 static inline void xsm_free_security_domain (struct domain *d) { - xsm_call(free_security_domain(d)); + (void)xsm_call(free_security_domain(d)); } =20 static inline int xsm_alloc_security_evtchn (struct evtchn *chn) @@ -376,7 +376,7 @@ static inline int xsm_alloc_security_evt =20 static inline void xsm_free_security_evtchn (struct evtchn *chn) { - xsm_call(free_security_evtchn(chn)); + (void)xsm_call(free_security_evtchn(chn)); } =20 static inline int xsm_memory_adjust_reservation (struct domain *d1, = struct --=__PartF5DA5014.0__= Content-Type: text/plain; name="no-Wno-unused-value.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="no-Wno-unused-value.patch" remove the use of -Wno-unused-value=0A=0AIt has been hiding actual = mistakes, and there are not too many changes=0Anecessary to make things = build without suppressing this warning.=0A=0ASigned-off-by: Jan Beulich = =0A=0A--- 2011-12-12.orig/Config.mk 2011-12-12 = 15:46:14.000000000 +0100=0A+++ 2011-12-12/Config.mk 2011-11-30 = 17:49:42.000000000 +0100=0A@@ -157,10 +157,6 @@ CFLAGS +=3D -std=3Dgnu99=0A= =0A CFLAGS +=3D -Wall -Wstrict-prototypes=0A =0A-# -Wunused-value makes = GCC 4.x too aggressive for my taste: ignoring the=0A-# result of any = casted expression causes a warning.=0A-CFLAGS +=3D -Wno-unused-value=0A-=0A= # Clang complains about macros that expand to 'if ( ( foo =3D=3D bar ) ) = ...'=0A # and is over-zealous with the printf format lint=0A CFLAGS-$(clang= ) +=3D -Wno-parentheses -Wno-format=0A--- 2011-12-12.orig/tools/libfsimage/= common/fsimage_grub.h 2010-04-19 09:12:58.000000000 +0200=0A+++ = 2011-12-12/tools/libfsimage/common/fsimage_grub.h 2011-12-12 = 15:47:35.000000000 +0100=0A@@ -57,7 +57,7 @@ typedef struct fsig_plugin_ops= {=0A #define disk_read_func (*fsig_disk_read_junk())=0A #define = disk_read_hook (*fsig_disk_read_junk())=0A #define print_possibilities= 0=0A-#define noisy_printf=0A+#define noisy_printf(fmt...)=0A =0A = #define grub_memset memset=0A #define grub_memmove memmove=0A--- = 2011-12-12.orig/xen/arch/x86/debug.c 2011-12-12 15:46:14.000000000 = +0100=0A+++ 2011-12-12/xen/arch/x86/debug.c 2011-11-30 17:50:55.0000000= 00 +0100=0A@@ -37,8 +37,8 @@=0A #define DBGP1(...) {(kdbdbg>1) ? kdbp(__VA_= ARGS__):0;}=0A #define DBGP2(...) {(kdbdbg>2) ? kdbp(__VA_ARGS__):0;}=0A = #else=0A-#define DBGP1(...) {0;}=0A-#define DBGP2(...) {0;}=0A+#define = DBGP1(...) ((void)0)=0A+#define DBGP2(...) ((void)0)=0A #endif=0A =0A /* = Returns: mfn for the given (hvm guest) vaddr */=0A--- 2011-12-12.orig/xen/a= rch/x86/hvm/svm/vpmu.c 2011-12-12 15:46:14.000000000 +0100=0A+++ = 2011-12-12/xen/arch/x86/hvm/svm/vpmu.c 2011-12-01 11:35:58.000000000 = +0100=0A@@ -154,7 +154,7 @@ static int amd_vpmu_do_interrupt(struct =0A = if ( GET_APIC_DELIVERY_MODE(vlapic_lvtpc) =3D=3D APIC_MODE_FIXED )=0A = vlapic_set_irq(vcpu_vlapic(v), int_vec, 0);=0A else=0A- = test_and_set_bool(v->nmi_pending);=0A+ v->nmi_pending =3D 1;=0A =0A = return 1;=0A }=0A--- 2011-12-12.orig/xen/arch/x86/hvm/vmx/vpmu_core2.c = 2011-12-12 15:46:14.000000000 +0100=0A+++ 2011-12-12/xen/arch/x86/hvm/vmx/v= pmu_core2.c 2011-12-01 11:36:37.000000000 +0100=0A@@ -574,7 +574,7 @@ = static int core2_vpmu_do_interrupt(struc=0A if ( GET_APIC_DELIVERY_MODE= (vlapic_lvtpc) =3D=3D APIC_MODE_FIXED )=0A vlapic_set_irq(vcpu_vlap= ic(v), int_vec, 0);=0A else=0A- test_and_set_bool(v->nmi_pending= );=0A+ v->nmi_pending =3D 1;=0A return 1;=0A }=0A =0A--- = 2011-12-12.orig/xen/arch/x86/oprofile/nmi_int.c 2011-12-12 15:46:14.0000000= 00 +0100=0A+++ 2011-12-12/xen/arch/x86/oprofile/nmi_int.c 2011-11-30 = 18:01:11.000000000 +0100=0A@@ -92,7 +92,7 @@ static int nmi_callback(struct= cpu_user_=0A send_guest_vcpu_virq(current, VIRQ_XENOPROF);=0A = =0A if ( ovf =3D=3D 2 ) =0A- test_and_set_bool(current->= nmi_pending);=0A+ current->nmi_pending =3D 1;=0A = return 1;=0A }=0A =0A--- 2011-12-12.orig/xen/include/asm-x86/debugger.h = 2011-12-12 15:46:14.000000000 +0100=0A+++ 2011-12-12/xen/include/asm-x86/de= bugger.h 2011-11-30 17:58:20.000000000 +0100=0A@@ -55,7 +55,12 @@ = static inline int debugger_trap_fatal(=0A =0A #else=0A =0A-#define = debugger_trap_fatal(v, r) (0)=0A+static inline int debugger_trap_fatal(=0A+= unsigned int vector, struct cpu_user_regs *regs)=0A+{=0A+ return = 0;=0A+}=0A+=0A #define debugger_trap_immediate() ((void)0)=0A =0A = #endif=0A--- 2011-12-12.orig/xen/include/asm-x86/hvm/hvm.h 2011-12-12 = 15:46:14.000000000 +0100=0A+++ 2011-12-12/xen/include/asm-x86/hvm/hvm.h = 2011-12-01 12:15:02.000000000 +0100=0A@@ -235,7 +235,7 @@ int hvm_girq_dest= _2_vcpu_id(struct domai=0A #define hvm_long_mode_enabled(v) \=0A = ((v)->arch.hvm_vcpu.guest_efer & EFER_LMA)=0A #else=0A-#define hvm_long_mod= e_enabled(v) (v,0)=0A+#define hvm_long_mode_enabled(v) ((void)(v),0)=0A = #endif=0A =0A enum hvm_intblk=0A--- 2011-12-12.orig/xen/include/xen/tmem_xe= n.h 2011-12-12 15:46:14.000000000 +0100=0A+++ 2011-12-12/xen/include/xe= n/tmem_xen.h 2011-11-30 17:55:22.000000000 +0100=0A@@ -365,7 +365,7 @@ = static inline int tmh_page_cmp(pfp_t *pf=0A // FIXME: code in = assembly?=0A ASSERT(p1 !=3D NULL);=0A ASSERT(p2 !=3D NULL);=0A- for ( i = =3D PAGE_SIZE/sizeof(uint64_t); i && *p1 =3D=3D *p2; i--, *p1++, *p2++ = );=0A+ for ( i =3D PAGE_SIZE/sizeof(uint64_t); i && *p1 =3D=3D *p2; = i--, p1++, p2++ );=0A if ( !i )=0A return 0;=0A if ( *p1 < = *p2 )=0A@@ -386,7 +386,7 @@ static inline int tmh_pcd_cmp(void *va1,=0A = if ( len1 > len2 )=0A return 1;=0A ASSERT(len1 =3D=3D = len2);=0A- for ( i =3D len2; i && *p1 =3D=3D *p2; i--, *p1++, *p2++ = );=0A+ for ( i =3D len2; i && *p1 =3D=3D *p2; i--, p1++, p2++ );=0A = if ( !i )=0A return 0;=0A if ( *p1 < *p2 )=0A@@ -413,7 +413,7 = @@ static inline int tmh_tze_pfp_cmp(pfp_t =0A if ( pfp_len > tze_len = )=0A return 1;=0A ASSERT(pfp_len =3D=3D tze_len);=0A- for ( = i =3D tze_len/sizeof(uint64_t); i && *p1 =3D=3D *p2; i--, *p1++, *p2++ = );=0A+ for ( i =3D tze_len/sizeof(uint64_t); i && *p1 =3D=3D *p2; i--, = p1++, p2++ );=0A if ( !i )=0A return 0;=0A if ( *p1 < *p2 = )=0A--- 2011-12-12.orig/xen/include/xsm/xsm.h 2011-12-12 15:46:14.0000000= 00 +0100=0A+++ 2011-12-12/xen/include/xsm/xsm.h 2011-12-12 15:23:49.0000000= 00 +0100=0A@@ -163,7 +163,7 @@ extern struct xsm_operations *xsm_ops;=0A = static inline void xsm_security_domaininfo (struct domain *d,=0A = struct xen_domctl_getdomaininfo *info)=0A = {=0A- xsm_call(security_domaininfo(d, info));=0A+ (void)xsm_call(secu= rity_domaininfo(d, info));=0A }=0A =0A static inline int xsm_setvcpucontext= (struct domain *d)=0A@@ -310,7 +310,7 @@ static inline int xsm_evtchn_inter= domain=0A =0A static inline void xsm_evtchn_close_post (struct evtchn = *chn)=0A {=0A- xsm_call(evtchn_close_post(chn));=0A+ (void)xsm_call(e= vtchn_close_post(chn));=0A }=0A =0A static inline int xsm_evtchn_send = (struct domain *d, struct evtchn *chn)=0A@@ -366,7 +366,7 @@ static inline = int xsm_alloc_security_dom=0A =0A static inline void xsm_free_security_doma= in (struct domain *d)=0A {=0A- xsm_call(free_security_domain(d));=0A+ = (void)xsm_call(free_security_domain(d));=0A }=0A =0A static inline int = xsm_alloc_security_evtchn (struct evtchn *chn)=0A@@ -376,7 +376,7 @@ = static inline int xsm_alloc_security_evt=0A =0A static inline void = xsm_free_security_evtchn (struct evtchn *chn)=0A {=0A- xsm_call(free_sec= urity_evtchn(chn));=0A+ (void)xsm_call(free_security_evtchn(chn));=0A = }=0A =0A static inline int xsm_memory_adjust_reservation (struct domain = *d1, struct=0A --=__PartF5DA5014.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=__PartF5DA5014.0__=--