From: "Jan Beulich" Subject: [PATCH] x86: drop pointless uses of __func__ / __FUNCTION__ Date: Wed, 24 Aug 2016 02:02:51 -0600 Message-ID: <57BD70CB02000078001087AD@prv-mh.provo.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part6D5B8ABB.1__=" Return-path: Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bcT9F-0008Ku-B4 for xen-devel@lists.xenproject.org; Wed, 24 Aug 2016 08:02:57 +0000 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: xen-devel Cc: Andrew Cooper 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. --=__Part6D5B8ABB.1__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Non-debugging message text should be (and is in the cases here) distinguishable without also logging function names. Debugging message text, otoh, already includes file name and line number, so also logging function names is redundant. One relatively pointless debugging message gets removed altogether. In another case a mising log level specifier gets added at once. Signed-off-by: Jan Beulich --- a/xen/arch/x86/io_apic.c +++ b/xen/arch/x86/io_apic.c @@ -2307,14 +2307,12 @@ int ioapic_guest_read(unsigned long phys return 0; } =20 -#define WARN_BOGUS_WRITE(f, a...) \ - dprintk(XENLOG_INFO, "\n" \ - XENLOG_INFO "%s: apic=3D%d, pin=3D%d, irq=3D%d\n" \ - XENLOG_INFO "%s: new_entry=3D%08x\n" \ - XENLOG_INFO "%s: " f "\n", \ - __func__, apic, pin, irq, \ - __func__, *(u32 *)&rte, \ - __func__, ##a ) +#define WARN_BOGUS_WRITE(f, a...) \ + dprintk(XENLOG_INFO, "\n" \ + XENLOG_INFO "IO-APIC: apic=3D%d, pin=3D%d, irq=3D%d\n" \ + XENLOG_INFO "IO-APIC: new_entry=3D%08x\n" \ + XENLOG_INFO "IO-APIC: " f "\n", \ + apic, pin, irq, *(u32 *)&rte, ##a ) =20 int ioapic_guest_write(unsigned long physbase, unsigned int reg, u32 val) { @@ -2385,9 +2383,9 @@ int ioapic_guest_write(unsigned long phy spin_unlock_irqrestore(&ioapic_lock, flags); rte.vector =3D desc->arch.vector; if ( *(u32*)&rte !=3D ret ) - WARN_BOGUS_WRITE("old_entry=3D%08x pirq=3D%d\n%s: " - "Attempt to modify IO-APIC pin for in-use = IRQ!", - ret, pirq, __FUNCTION__); + WARN_BOGUS_WRITE("old_entry=3D%08x pirq=3D%d\n" XENLOG_INFO + "IO-APIC: Attempt to modify IO-APIC pin for = in-use IRQ!", + ret, pirq); return 0; } =20 --- a/xen/arch/x86/irq.c +++ b/xen/arch/x86/irq.c @@ -404,10 +404,8 @@ static vmask_t *irq_get_used_vector_mask ret =3D &global_used_vector_map; =20 if ( desc->arch.used_vectors ) - { - printk(XENLOG_INFO "%s: Strange, unassigned irq %d already = has used_vectors!\n", - __func__, irq); - } + printk(XENLOG_INFO "Unassigned IRQ %d already has used_vectors= \n", + irq); else { int vector; @@ -415,8 +413,8 @@ static vmask_t *irq_get_used_vector_mask vector =3D irq_to_vector(irq); if ( vector > 0 ) { - printk(XENLOG_INFO "%s: Strange, irq %d already assigned = vector %d!\n", - __func__, irq, vector); + printk(XENLOG_INFO "IRQ %d already assigned vector %d\n", + irq, vector); =20 ASSERT(!test_bit(vector, ret)); =20 --- a/xen/arch/x86/msi.c +++ b/xen/arch/x86/msi.c @@ -164,10 +164,7 @@ void msi_compose_msg(unsigned vector, co =20 memset(msg, 0, sizeof(*msg)); if ( !cpumask_intersects(cpu_mask, &cpu_online_map) ) - { - dprintk(XENLOG_ERR,"%s, compose msi message error!!\n", __func__);= return; - } =20 if ( vector ) { --- a/xen/arch/x86/time.c +++ b/xen/arch/x86/time.c @@ -1467,8 +1467,7 @@ static int __init verify_tsc_reliability tsc_check_reliability(); if ( tsc_max_warp ) { - printk("%s: TSC warp detected, disabling TSC_RELIABLE\n", - __func__); + printk("TSC warp detected, disabling TSC_RELIABLE\n"); setup_clear_cpu_cap(X86_FEATURE_TSC_RELIABLE); } } --- a/xen/arch/x86/xstate.c +++ b/xen/arch/x86/xstate.c @@ -574,8 +574,8 @@ void xstate_init(struct cpuinfo_x86 *c) * We know FP/SSE and YMM about eax, and nothing about edx at = present. */ xsave_cntxt_size =3D _xstate_ctxt_size(feature_mask); - printk("%s: using cntxt_size: %#x and states: %#"PRIx64"\n", - __func__, xsave_cntxt_size, xfeature_mask); + printk("xstate: size: %#x and states: %#"PRIx64"\n", + xsave_cntxt_size, xfeature_mask); =20 asm ( "fxsave %0" : "=3Dm" (ctxt) ); if ( ctxt.mxcsr_mask ) --=__Part6D5B8ABB.1__= Content-Type: text/plain; name="x86-drop-__func__.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-drop-__func__.patch" x86: drop pointless uses of __func__ / __FUNCTION__=0A=0ANon-debugging = message text should be (and is in the cases here)=0Adistinguishable = without also logging function names. Debugging message=0Atext, otoh, = already includes file name and line number, so also=0Alogging function = names is redundant. One relatively pointless debugging=0Amessage gets = removed altogether. In another case a mising log level=0Aspecifier gets = added at once.=0A=0ASigned-off-by: Jan Beulich =0A=0A---= a/xen/arch/x86/io_apic.c=0A+++ b/xen/arch/x86/io_apic.c=0A@@ -2307,14 = +2307,12 @@ int ioapic_guest_read(unsigned long phys=0A return 0;=0A = }=0A =0A-#define WARN_BOGUS_WRITE(f, a...) \=0A- = dprintk(XENLOG_INFO, "\n" \=0A- = XENLOG_INFO "%s: apic=3D%d, pin=3D%d, irq=3D%d\n" \=0A- = XENLOG_INFO "%s: new_entry=3D%08x\n" \=0A- XENLOG_INFO = "%s: " f "\n", \=0A- __func__, apic, pin, irq, = \=0A- __func__, *(u32 *)&rte, = \=0A- __func__, ##a )=0A+#define WARN_BOGUS_WRITE(f, a...) = \=0A+ dprintk(XENLOG_INFO, "\n" = \=0A+ XENLOG_INFO "IO-APIC: apic=3D%d, = pin=3D%d, irq=3D%d\n" \=0A+ XENLOG_INFO "IO-APIC: new_entry=3D%0= 8x\n" \=0A+ XENLOG_INFO "IO-APIC: " f "\n", = \=0A+ apic, pin, irq, *(u32 *)&rte, ##a )=0A =0A int = ioapic_guest_write(unsigned long physbase, unsigned int reg, u32 val)=0A = {=0A@@ -2385,9 +2383,9 @@ int ioapic_guest_write(unsigned long phy=0A = spin_unlock_irqrestore(&ioapic_lock, flags);=0A rte.vector =3D = desc->arch.vector;=0A if ( *(u32*)&rte !=3D ret )=0A- = WARN_BOGUS_WRITE("old_entry=3D%08x pirq=3D%d\n%s: "=0A- = "Attempt to modify IO-APIC pin for in-use IRQ!",=0A- = ret, pirq, __FUNCTION__);=0A+ WARN_BOGUS_WRITE("o= ld_entry=3D%08x pirq=3D%d\n" XENLOG_INFO=0A+ = "IO-APIC: Attempt to modify IO-APIC pin for in-use IRQ!",=0A+ = ret, pirq);=0A return 0;=0A }=0A =0A--- = a/xen/arch/x86/irq.c=0A+++ b/xen/arch/x86/irq.c=0A@@ -404,10 +404,8 @@ = static vmask_t *irq_get_used_vector_mask=0A ret =3D &global_used_ve= ctor_map;=0A =0A if ( desc->arch.used_vectors )=0A- {=0A- = printk(XENLOG_INFO "%s: Strange, unassigned irq %d already has = used_vectors!\n",=0A- __func__, irq);=0A- }=0A+ = printk(XENLOG_INFO "Unassigned IRQ %d already has used_vectors\n",= =0A+ irq);=0A else=0A {=0A = int vector;=0A@@ -415,8 +413,8 @@ static vmask_t *irq_get_used_vector_mask= =0A vector =3D irq_to_vector(irq);=0A if ( vector = > 0 )=0A {=0A- printk(XENLOG_INFO "%s: Strange, = irq %d already assigned vector %d!\n",=0A- __func__, = irq, vector);=0A+ printk(XENLOG_INFO "IRQ %d already = assigned vector %d\n",=0A+ irq, vector);=0A = =0A ASSERT(!test_bit(vector, ret));=0A =0A--- = a/xen/arch/x86/msi.c=0A+++ b/xen/arch/x86/msi.c=0A@@ -164,10 +164,7 @@ = void msi_compose_msg(unsigned vector, co=0A =0A memset(msg, 0, = sizeof(*msg));=0A if ( !cpumask_intersects(cpu_mask, &cpu_online_map) = )=0A- {=0A- dprintk(XENLOG_ERR,"%s, compose msi message = error!!\n", __func__);=0A return;=0A- }=0A =0A if ( vector = )=0A {=0A--- a/xen/arch/x86/time.c=0A+++ b/xen/arch/x86/time.c=0A@@ = -1467,8 +1467,7 @@ static int __init verify_tsc_reliability=0A = tsc_check_reliability();=0A if ( tsc_max_warp )=0A {=0A- = printk("%s: TSC warp detected, disabling TSC_RELIABLE\n",=0A- = __func__);=0A+ printk("TSC warp detected, = disabling TSC_RELIABLE\n");=0A setup_clear_cpu_cap(X86_FEATURE_= TSC_RELIABLE);=0A }=0A }=0A--- a/xen/arch/x86/xstate.c=0A+++ = b/xen/arch/x86/xstate.c=0A@@ -574,8 +574,8 @@ void xstate_init(struct = cpuinfo_x86 *c)=0A * We know FP/SSE and YMM about eax, and = nothing about edx at present.=0A */=0A xsave_cntxt_size = =3D _xstate_ctxt_size(feature_mask);=0A- printk("%s: using = cntxt_size: %#x and states: %#"PRIx64"\n",=0A- __func__, = xsave_cntxt_size, xfeature_mask);=0A+ printk("xstate: size: %#x and = states: %#"PRIx64"\n",=0A+ xsave_cntxt_size, xfeature_mask);= =0A =0A asm ( "fxsave %0" : "=3Dm" (ctxt) );=0A if ( = ctxt.mxcsr_mask )=0A --=__Part6D5B8ABB.1__= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwczovL2xpc3RzLnhlbi5v cmcveGVuLWRldmVsCg== --=__Part6D5B8ABB.1__=--