diff mbox series

VT-d: Adjust diagnostics in set_msi_source_id()

Message ID 20250314095523.4096604-1-andrew.cooper3@citrix.com (mailing list archive)
State New
Headers show
Series VT-d: Adjust diagnostics in set_msi_source_id() | expand

Commit Message

Andrew Cooper March 14, 2025, 9:55 a.m. UTC
Use %pd, and state what the unknown is.  As it's an enum, it's a signed type.

Also drop one piece of trailing whitespace.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/drivers/passthrough/vtd/intremap.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Roger Pau Monné March 14, 2025, 10:15 a.m. UTC | #1
On Fri, Mar 14, 2025 at 09:55:23AM +0000, Andrew Cooper wrote:
> Use %pd, and state what the unknown is.  As it's an enum, it's a signed type.
> 
> Also drop one piece of trailing whitespace.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Acked-by: Roger Pau Monné <roger.pau@citrix.com>

> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Roger Pau Monné <roger.pau@citrix.com>
> ---
>  xen/drivers/passthrough/vtd/intremap.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c
> index 81394ef45299..9272a2511398 100644
> --- a/xen/drivers/passthrough/vtd/intremap.c
> +++ b/xen/drivers/passthrough/vtd/intremap.c
> @@ -485,15 +485,15 @@ static int set_msi_source_id(const struct pci_dev *pdev,
>          else
>          {
>              dprintk(XENLOG_WARNING VTDPREFIX,
> -                    "d%d: no upstream bridge for %pp\n",
> -                    pdev->domain->domain_id, &pdev->sbdf);
> +                    "%pd: no upstream bridge for %pp\n",
> +                    pdev->domain, &pdev->sbdf);
>              return -ENXIO;
>          }
>          break;
>  
>      default:
> -        dprintk(XENLOG_WARNING VTDPREFIX, "d%d: unknown(%u): %pp\n",
> -                pdev->domain->domain_id, pdev->type, &pdev->sbdf);
> +        dprintk(XENLOG_WARNING VTDPREFIX, "%pd: %pp unknown device type %d\n",
> +                pdev->domain, &pdev->sbdf, pdev->type);

Would be nice to have a pdev_type_to_str() or similar helper.

Thanks, Roger.
Andrew Cooper March 14, 2025, 11:51 a.m. UTC | #2
On 14/03/2025 10:15 am, Roger Pau Monné wrote:
> On Fri, Mar 14, 2025 at 09:55:23AM +0000, Andrew Cooper wrote:
>> Use %pd, and state what the unknown is.  As it's an enum, it's a signed type.
>>
>> Also drop one piece of trailing whitespace.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Acked-by: Roger Pau Monné <roger.pau@citrix.com>

Thanks.

>
>> ---
>> CC: Jan Beulich <JBeulich@suse.com>
>> CC: Roger Pau Monné <roger.pau@citrix.com>
>> ---
>>  xen/drivers/passthrough/vtd/intremap.c | 10 +++++-----
>>  1 file changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c
>> index 81394ef45299..9272a2511398 100644
>> --- a/xen/drivers/passthrough/vtd/intremap.c
>> +++ b/xen/drivers/passthrough/vtd/intremap.c
>> @@ -485,15 +485,15 @@ static int set_msi_source_id(const struct pci_dev *pdev,
>>          else
>>          {
>>              dprintk(XENLOG_WARNING VTDPREFIX,
>> -                    "d%d: no upstream bridge for %pp\n",
>> -                    pdev->domain->domain_id, &pdev->sbdf);
>> +                    "%pd: no upstream bridge for %pp\n",
>> +                    pdev->domain, &pdev->sbdf);
>>              return -ENXIO;
>>          }
>>          break;
>>  
>>      default:
>> -        dprintk(XENLOG_WARNING VTDPREFIX, "d%d: unknown(%u): %pp\n",
>> -                pdev->domain->domain_id, pdev->type, &pdev->sbdf);
>> +        dprintk(XENLOG_WARNING VTDPREFIX, "%pd: %pp unknown device type %d\n",
>> +                pdev->domain, &pdev->sbdf, pdev->type);
> Would be nice to have a pdev_type_to_str() or similar helper.

In this case, I think we'd only get UNKNOWN out of it, based on what
else the switch() handles.

~Andrew
diff mbox series

Patch

diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c
index 81394ef45299..9272a2511398 100644
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -485,15 +485,15 @@  static int set_msi_source_id(const struct pci_dev *pdev,
         else
         {
             dprintk(XENLOG_WARNING VTDPREFIX,
-                    "d%d: no upstream bridge for %pp\n",
-                    pdev->domain->domain_id, &pdev->sbdf);
+                    "%pd: no upstream bridge for %pp\n",
+                    pdev->domain, &pdev->sbdf);
             return -ENXIO;
         }
         break;
 
     default:
-        dprintk(XENLOG_WARNING VTDPREFIX, "d%d: unknown(%u): %pp\n",
-                pdev->domain->domain_id, pdev->type, &pdev->sbdf);
+        dprintk(XENLOG_WARNING VTDPREFIX, "%pd: %pp unknown device type %d\n",
+                pdev->domain, &pdev->sbdf, pdev->type);
         return -EOPNOTSUPP;
     }
 
@@ -751,7 +751,7 @@  void disable_intremap(struct vtd_iommu *iommu)
                   !(sts & DMA_GSTS_IRES), sts);
 
     /* If we are disabling Interrupt Remapping, make sure we dont stay in
-     * Extended Interrupt Mode, as this is unaffected by the Interrupt 
+     * Extended Interrupt Mode, as this is unaffected by the Interrupt
      * Remapping flag in each DMAR Global Control Register.
      * Specifically, local apics in xapic mode do not like interrupts delivered
      * in x2apic mode.  Any code turning interrupt remapping back on will set