xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pass-through: drop pointless uses of __func__
@ 2016-08-24  7:51 Jan Beulich
  2016-08-24 20:28 ` Konrad Rzeszutek Wilk
  2016-08-31 18:36 ` Andrew Cooper
  0 siblings, 2 replies; 4+ messages in thread
From: Jan Beulich @ 2016-08-24  7:51 UTC (permalink / raw)
  To: xen-devel

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

Non-debugging message text should be (and is in the cases here)
distinguishable without also logging function names. Additionally log
the PCI device coordinates for alloc_pdev() failure.

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

--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -379,8 +379,8 @@ static struct pci_dev *alloc_pdev(struct
             break;
 
         default:
-            printk(XENLOG_WARNING "%s: unknown type: %04x:%02x:%02x.%u\n",
-                   __func__, pseg->nr, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
+            printk(XENLOG_WARNING "%04x:%02x:%02x.%u: unknown type %d\n",
+                   pseg->nr, bus, PCI_SLOT(devfn), PCI_FUNC(devfn), pdev->type);
             break;
     }
 
@@ -991,7 +991,8 @@ static int __init _scan_pci_devices(stru
                 pdev = alloc_pdev(pseg, bus, PCI_DEVFN(dev, func));
                 if ( !pdev )
                 {
-                    printk("%s: alloc_pdev failed.\n", __func__);
+                    printk(XENLOG_WARNING "%04x:%02x:%02x.%u: alloc_pdev failed\n",
+                           pseg->nr, bus, dev, func);
                     return -ENOMEM;
                 }
 




[-- Attachment #2: pt-drop-__func__.patch --]
[-- Type: text/plain, Size: 1273 bytes --]

pass-through: drop pointless uses of __func__

Non-debugging message text should be (and is in the cases here)
distinguishable without also logging function names. Additionally log
the PCI device coordinates for alloc_pdev() failure.

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

--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -379,8 +379,8 @@ static struct pci_dev *alloc_pdev(struct
             break;
 
         default:
-            printk(XENLOG_WARNING "%s: unknown type: %04x:%02x:%02x.%u\n",
-                   __func__, pseg->nr, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
+            printk(XENLOG_WARNING "%04x:%02x:%02x.%u: unknown type %d\n",
+                   pseg->nr, bus, PCI_SLOT(devfn), PCI_FUNC(devfn), pdev->type);
             break;
     }
 
@@ -991,7 +991,8 @@ static int __init _scan_pci_devices(stru
                 pdev = alloc_pdev(pseg, bus, PCI_DEVFN(dev, func));
                 if ( !pdev )
                 {
-                    printk("%s: alloc_pdev failed.\n", __func__);
+                    printk(XENLOG_WARNING "%04x:%02x:%02x.%u: alloc_pdev failed\n",
+                           pseg->nr, bus, dev, func);
                     return -ENOMEM;
                 }
 

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

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH] pass-through: drop pointless uses of __func__
  2016-08-24  7:51 [PATCH] pass-through: drop pointless uses of __func__ Jan Beulich
@ 2016-08-24 20:28 ` Konrad Rzeszutek Wilk
  2016-08-31 18:36 ` Andrew Cooper
  1 sibling, 0 replies; 4+ messages in thread
From: Konrad Rzeszutek Wilk @ 2016-08-24 20:28 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel

On Wed, Aug 24, 2016 at 01:51:13AM -0600, Jan Beulich wrote:
> Non-debugging message text should be (and is in the cases here)
> distinguishable without also logging function names. Additionally log
> the PCI device coordinates for alloc_pdev() failure.
> 

Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> --- a/xen/drivers/passthrough/pci.c
> +++ b/xen/drivers/passthrough/pci.c
> @@ -379,8 +379,8 @@ static struct pci_dev *alloc_pdev(struct
>              break;
>  
>          default:
> -            printk(XENLOG_WARNING "%s: unknown type: %04x:%02x:%02x.%u\n",
> -                   __func__, pseg->nr, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
> +            printk(XENLOG_WARNING "%04x:%02x:%02x.%u: unknown type %d\n",
> +                   pseg->nr, bus, PCI_SLOT(devfn), PCI_FUNC(devfn), pdev->type);
>              break;
>      }
>  
> @@ -991,7 +991,8 @@ static int __init _scan_pci_devices(stru
>                  pdev = alloc_pdev(pseg, bus, PCI_DEVFN(dev, func));
>                  if ( !pdev )
>                  {
> -                    printk("%s: alloc_pdev failed.\n", __func__);
> +                    printk(XENLOG_WARNING "%04x:%02x:%02x.%u: alloc_pdev failed\n",
> +                           pseg->nr, bus, dev, func);
>                      return -ENOMEM;
>                  }
>  
> 
> 
> 

> pass-through: drop pointless uses of __func__
> 
> Non-debugging message text should be (and is in the cases here)
> distinguishable without also logging function names. Additionally log
> the PCI device coordinates for alloc_pdev() failure.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> --- a/xen/drivers/passthrough/pci.c
> +++ b/xen/drivers/passthrough/pci.c
> @@ -379,8 +379,8 @@ static struct pci_dev *alloc_pdev(struct
>              break;
>  
>          default:
> -            printk(XENLOG_WARNING "%s: unknown type: %04x:%02x:%02x.%u\n",
> -                   __func__, pseg->nr, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
> +            printk(XENLOG_WARNING "%04x:%02x:%02x.%u: unknown type %d\n",
> +                   pseg->nr, bus, PCI_SLOT(devfn), PCI_FUNC(devfn), pdev->type);
>              break;
>      }
>  
> @@ -991,7 +991,8 @@ static int __init _scan_pci_devices(stru
>                  pdev = alloc_pdev(pseg, bus, PCI_DEVFN(dev, func));
>                  if ( !pdev )
>                  {
> -                    printk("%s: alloc_pdev failed.\n", __func__);
> +                    printk(XENLOG_WARNING "%04x:%02x:%02x.%u: alloc_pdev failed\n",
> +                           pseg->nr, bus, dev, func);
>                      return -ENOMEM;
>                  }
>  

> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> https://lists.xen.org/xen-devel


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH] pass-through: drop pointless uses of __func__
  2016-08-24  7:51 [PATCH] pass-through: drop pointless uses of __func__ Jan Beulich
  2016-08-24 20:28 ` Konrad Rzeszutek Wilk
@ 2016-08-31 18:36 ` Andrew Cooper
  2016-09-01  7:11   ` Jan Beulich
  1 sibling, 1 reply; 4+ messages in thread
From: Andrew Cooper @ 2016-08-31 18:36 UTC (permalink / raw)
  To: Jan Beulich, xen-devel

On 24/08/16 08:51, Jan Beulich wrote:
> Non-debugging message text should be (and is in the cases here)
> distinguishable without also logging function names. Additionally log
> the PCI device coordinates for alloc_pdev() failure.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

On this note, I have a series I never really started properly, which
introduces a single pci_sbdf_t, totalling 32 bits of bitfields, and a
custom %p handler.  The register shuffling required in all the function
calls taking 4 parameters for the PCI SBDF which total 32 bits seems
extremely wasteful.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH] pass-through: drop pointless uses of __func__
  2016-08-31 18:36 ` Andrew Cooper
@ 2016-09-01  7:11   ` Jan Beulich
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Beulich @ 2016-09-01  7:11 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: xen-devel

>>> On 31.08.16 at 20:36, <andrew.cooper3@citrix.com> wrote:
> On this note, I have a series I never really started properly, which
> introduces a single pci_sbdf_t, totalling 32 bits of bitfields, and a
> custom %p handler.  The register shuffling required in all the function
> calls taking 4 parameters for the PCI SBDF which total 32 bits seems
> extremely wasteful.

Oh, yes, I've been meaning to get to this too, but never really did.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

end of thread, other threads:[~2016-09-01  7:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-24  7:51 [PATCH] pass-through: drop pointless uses of __func__ Jan Beulich
2016-08-24 20:28 ` Konrad Rzeszutek Wilk
2016-08-31 18:36 ` Andrew Cooper
2016-09-01  7:11   ` Jan Beulich

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).