From: "Jan Beulich" Subject: [PATCH] XSM: drop pointless uses of __FUNCTION__ Date: Wed, 24 Aug 2016 02:06:23 -0600 Message-ID: <57BD719F02000078001087C3@prv-mh.provo.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartB88E5F6F.0__=" Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bcTCe-0000BW-3x for xen-devel@lists.xenproject.org; Wed, 24 Aug 2016 08:06:28 +0000 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: xen-devel Cc: Daniel de Graaf 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. --=__PartB88E5F6F.0__= 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. Signed-off-by: Jan Beulich --- a/xen/xsm/flask/hooks.c +++ b/xen/xsm/flask/hooks.c @@ -241,8 +241,8 @@ static int flask_evtchn_interdomain(stru rc =3D security_transition_sid(sid1, sid2, SECCLASS_EVENT, &newsid); if ( rc ) { - printk("%s: security_transition_sid failed, rc=3D%d (domain=3D%d)\= n", - __FUNCTION__, -rc, d2->domain_id); + printk("security_transition_sid failed, rc=3D%d, Dom%d\n", + -rc, d2->domain_id); return rc; } =20 --- a/xen/xsm/flask/ss/services.c +++ b/xen/xsm/flask/ss/services.c @@ -1995,7 +1995,7 @@ int security_ocontext_add( u32 ocon, uns { if ( c->sid =3D=3D sid ) break; - printk("%s: Duplicate pirq %d\n", __FUNCTION__, add->u.pir= q); + printk("flask: Duplicate pirq %d\n", add->u.pirq); ret =3D -EEXIST; break; } @@ -2027,9 +2027,8 @@ int security_ocontext_add( u32 ocon, uns c->u.ioport.high_ioport =3D=3D high && c->sid =3D=3D sid) break; =20 - printk("%s: IO Port overlap with entry %#x - %#x\n", - __FUNCTION__, c->u.ioport.low_ioport, - c->u.ioport.high_ioport); + printk("flask: IO Port overlap with entry %#x - %#x\n", + c->u.ioport.low_ioport, c->u.ioport.high_ioport); ret =3D -EEXIST; break; } @@ -2061,8 +2060,8 @@ int security_ocontext_add( u32 ocon, uns c->u.iomem.high_iomem =3D=3D high && c->sid =3D=3D sid) break; =20 - printk("%s: IO Memory overlap with entry %#"PRIx64" - = %#"PRIx64"\n", - __FUNCTION__, c->u.iomem.low_iomem, c->u.iomem.high_iom= em); + printk("flask: IO Memory overlap with entry %#"PRIx64" - = %#"PRIx64"\n", + c->u.iomem.low_iomem, c->u.iomem.high_iomem); ret =3D -EEXIST; break; } @@ -2092,8 +2091,7 @@ int security_ocontext_add( u32 ocon, uns if ( c->sid =3D=3D sid ) break; =20 - printk("%s: Duplicate PCI Device %#x\n", __FUNCTION__, - add->u.device); + printk("flask: Duplicate PCI Device %#x\n", add->u.device)= ; ret =3D -EEXIST; break; } @@ -2146,7 +2144,7 @@ int security_ocontext_del( u32 ocon, uns } } =20 - printk("%s: ocontext not found: pirq %ld\n", __FUNCTION__, low); + printk("flask: ocontext not found: pirq %ld\n", low); ret =3D -ENOENT; break; =20 @@ -2172,8 +2170,7 @@ int security_ocontext_del( u32 ocon, uns } } =20 - printk("%s: ocontext not found: ioport %#lx - %#lx\n", - __FUNCTION__, low, high); + printk("flask: ocontext not found: ioport %#lx - %#lx\n", low, = high); ret =3D -ENOENT; break; =20 @@ -2199,8 +2196,7 @@ int security_ocontext_del( u32 ocon, uns } } =20 - printk("%s: ocontext not found: iomem %#lx - %#lx\n", - __FUNCTION__, low, high); + printk("flask: ocontext not found: iomem %#lx - %#lx\n", low, = high); ret =3D -ENOENT; break; =20 @@ -2225,7 +2221,7 @@ int security_ocontext_del( u32 ocon, uns } } =20 - printk("%s: ocontext not found: pcidevice %#lx\n", __FUNCTION__, = low); + printk("flask: ocontext not found: pcidevice %#lx\n", low); ret =3D -ENOENT; break; =20 --- a/xen/xsm/xsm_core.c +++ b/xen/xsm/xsm_core.c @@ -48,8 +48,7 @@ static int __init xsm_core_init(const vo =20 if ( verify(&dummy_xsm_ops) ) { - printk("%s could not verify " - "dummy_xsm_ops structure.\n", __FUNCTION__); + printk(XENLOG_ERR "Could not verify dummy_xsm_ops structure\n"); return -EIO; } =20 @@ -77,7 +76,7 @@ int __init xsm_multiboot_init(unsigned l if ( ret ) { bootstrap_map(NULL); - printk("%s: Error initializing policy.\n", __FUNCTION__); + printk(XENLOG_ERR "Error %d initializing XSM policy\n", ret); return -EINVAL; } } @@ -103,8 +102,7 @@ int __init xsm_dt_init(void) ret =3D xsm_dt_policy_init(&policy_buffer, &policy_size); if ( ret ) { - printk("%s: Error initializing policy (rc =3D %d).\n", - __FUNCTION__, ret); + printk(XENLOG_ERR "Error %d initializing XSM policy\n", ret); return -EINVAL; } } @@ -144,8 +142,7 @@ int __init register_xsm(struct xsm_opera { if ( verify(ops) ) { - printk("%s could not verify " - "security_operations structure.\n", __FUNCTION__); + printk(XENLOG_ERR "Could not verify xsm_operations structure\n"); return -EINVAL; } =20 --=__PartB88E5F6F.0__= Content-Type: text/plain; name="XSM-drop-__FUNCTION__.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="XSM-drop-__FUNCTION__.patch" XSM: drop pointless uses of __FUNCTION__=0A=0ANon-debugging message text = should be (and is in the cases here)=0Adistinguishable without also = logging function names.=0A=0ASigned-off-by: Jan Beulich = =0A=0A--- a/xen/xsm/flask/hooks.c=0A+++ b/xen/xsm/flask/hooks.c=0A@@ = -241,8 +241,8 @@ static int flask_evtchn_interdomain(stru=0A rc =3D = security_transition_sid(sid1, sid2, SECCLASS_EVENT, &newsid);=0A if ( = rc )=0A {=0A- printk("%s: security_transition_sid failed, = rc=3D%d (domain=3D%d)\n",=0A- __FUNCTION__, -rc, d2->domain_i= d);=0A+ printk("security_transition_sid failed, rc=3D%d, = Dom%d\n",=0A+ -rc, d2->domain_id);=0A return rc;=0A = }=0A =0A--- a/xen/xsm/flask/ss/services.c=0A+++ b/xen/xsm/flask/ss/servi= ces.c=0A@@ -1995,7 +1995,7 @@ int security_ocontext_add( u32 ocon, uns=0A = {=0A if ( c->sid =3D=3D sid )=0A = break;=0A- printk("%s: Duplicate pirq %d\n", __FUNCTION= __, add->u.pirq);=0A+ printk("flask: Duplicate pirq %d\n", = add->u.pirq);=0A ret =3D -EEXIST;=0A = break;=0A }=0A@@ -2027,9 +2027,8 @@ int security_ocontext_add( = u32 ocon, uns=0A c->u.ioport.high_ioport =3D=3D high && = c->sid =3D=3D sid)=0A break;=0A =0A- printk("%s:= IO Port overlap with entry %#x - %#x\n",=0A- __FUNCTION_= _, c->u.ioport.low_ioport,=0A- c->u.ioport.high_ioport);= =0A+ printk("flask: IO Port overlap with entry %#x - %#x\n",=0A+= c->u.ioport.low_ioport, c->u.ioport.high_ioport);=0A = ret =3D -EEXIST;=0A break;=0A }=0A@@ -2061,8 = +2060,8 @@ int security_ocontext_add( u32 ocon, uns=0A = c->u.iomem.high_iomem =3D=3D high && c->sid =3D=3D sid)=0A = break;=0A =0A- printk("%s: IO Memory overlap with entry = %#"PRIx64" - %#"PRIx64"\n",=0A- __FUNCTION__, c->u.iomem.= low_iomem, c->u.iomem.high_iomem);=0A+ printk("flask: IO Memory = overlap with entry %#"PRIx64" - %#"PRIx64"\n",=0A+ = c->u.iomem.low_iomem, c->u.iomem.high_iomem);=0A ret =3D = -EEXIST;=0A break;=0A }=0A@@ -2092,8 +2091,7 @@ int = security_ocontext_add( u32 ocon, uns=0A if ( c->sid =3D=3D = sid )=0A break;=0A =0A- printk("%s: = Duplicate PCI Device %#x\n", __FUNCTION__,=0A- = add->u.device);=0A+ printk("flask: Duplicate PCI Device = %#x\n", add->u.device);=0A ret =3D -EEXIST;=0A = break;=0A }=0A@@ -2146,7 +2144,7 @@ int security_ocontext_d= el( u32 ocon, uns=0A }=0A }=0A =0A- printk("%s: = ocontext not found: pirq %ld\n", __FUNCTION__, low);=0A+ printk("fla= sk: ocontext not found: pirq %ld\n", low);=0A ret =3D -ENOENT;=0A = break;=0A =0A@@ -2172,8 +2170,7 @@ int security_ocontext_del( u32 = ocon, uns=0A }=0A }=0A =0A- printk("%s: = ocontext not found: ioport %#lx - %#lx\n",=0A- __FUNCTION__,= low, high);=0A+ printk("flask: ocontext not found: ioport %#lx - = %#lx\n", low, high);=0A ret =3D -ENOENT;=0A break;=0A = =0A@@ -2199,8 +2196,7 @@ int security_ocontext_del( u32 ocon, uns=0A = }=0A }=0A =0A- printk("%s: ocontext not found: iomem = %#lx - %#lx\n",=0A- __FUNCTION__, low, high);=0A+ = printk("flask: ocontext not found: iomem %#lx - %#lx\n", low, high);=0A = ret =3D -ENOENT;=0A break;=0A =0A@@ -2225,7 +2221,7 @@ int = security_ocontext_del( u32 ocon, uns=0A }=0A }=0A =0A- = printk("%s: ocontext not found: pcidevice %#lx\n", __FUNCTION__, = low);=0A+ printk("flask: ocontext not found: pcidevice %#lx\n", = low);=0A ret =3D -ENOENT;=0A break;=0A =0A--- a/xen/xsm/xsm= _core.c=0A+++ b/xen/xsm/xsm_core.c=0A@@ -48,8 +48,7 @@ static int __init = xsm_core_init(const vo=0A =0A if ( verify(&dummy_xsm_ops) )=0A = {=0A- printk("%s could not verify "=0A- "dummy_xsm_ops= structure.\n", __FUNCTION__);=0A+ printk(XENLOG_ERR "Could not = verify dummy_xsm_ops structure\n");=0A return -EIO;=0A }=0A = =0A@@ -77,7 +76,7 @@ int __init xsm_multiboot_init(unsigned l=0A = if ( ret )=0A {=0A bootstrap_map(NULL);=0A- = printk("%s: Error initializing policy.\n", __FUNCTION__);=0A+ = printk(XENLOG_ERR "Error %d initializing XSM policy\n", ret);=0A = return -EINVAL;=0A }=0A }=0A@@ -103,8 +102,7 @@ int __init = xsm_dt_init(void)=0A ret =3D xsm_dt_policy_init(&policy_buffer, = &policy_size);=0A if ( ret )=0A {=0A- printk("%s= : Error initializing policy (rc =3D %d).\n",=0A- = __FUNCTION__, ret);=0A+ printk(XENLOG_ERR "Error %d initializing= XSM policy\n", ret);=0A return -EINVAL;=0A }=0A = }=0A@@ -144,8 +142,7 @@ int __init register_xsm(struct xsm_opera=0A {=0A = if ( verify(ops) )=0A {=0A- printk("%s could not verify "=0A- = "security_operations structure.\n", __FUNCTION__);=0A+ = printk(XENLOG_ERR "Could not verify xsm_operations structure\n");=0A = return -EINVAL;=0A }=0A =0A --=__PartB88E5F6F.0__= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwczovL2xpc3RzLnhlbi5v cmcveGVuLWRldmVsCg== --=__PartB88E5F6F.0__=--