[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 2/2] xen/arm: domain_build: Fix format specifiers in map_{dt_}irq_to_domain()


  • To: Michal Orzel <michal.orzel@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Ayan Kumar Halder <ayankuma@xxxxxxx>
  • Date: Thu, 11 May 2023 16:23:01 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9EIhEWeo7uRyaVVlo82soj0URdLOT8LPVKCRwaKMklo=; b=EgZcdTlKY2ibo4dHYo6tVFUncwNNbTcsQXMvMddSP7xN40DP0qx9e5ToYXA9QzDQOwuZN+iDa7Fy1OjtJVyT56avVAXqsib945KSjmQ318mVfBn4IiK3Dyxz+9U7qXFZYgsAX4/lAWXFp2qpJGkzEi6TByqeODl1RN2db5zBW820ZvIJWSPXsC4/pi38ATjXKmviIJm22XOPYdQrHDHvxjnK81J50QgkzYKIr2LqSv35b1qKd7Stu1V6cyORm8HQ+ZhL8IvgXoFFLwHDtW/Y87e0YnPbCby2ZgAuxKgb8TlBgcPVJ8M9iunD4DDFvPsIdVqepiwjuE7h7vLATAH8bQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LhrK0B/tnLPFUPbz/tQI8DlAnZf3BXQ1/8o++fGxUmZhJtcwGPpw792Kw6lDEJrl5caFsZTGPprHYZirZ38NxX+rtaOOD7bJEO5y5nhEnD/UBCiZZHwPoPdapBJT3nprBGeLtKC8KknsW6LOX5vo3XwN3qhhXlSTuaxmrfdUJctN1/cZ2fRJJpfm2a4KGbK82c/c+bGhLc1+bwD1Qu73VRlSWJ1DI+tVjCt+MmKW0s3cls+UwwXrBfebyjOCAsv9dJy58lJlizDd2mKfS+A4GEWNRwuQHmEaQxq83DWIvpFLFxngNouQL3K3sGeCjLPuzEsuoChhQq6bKlI+Tn8MkQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Thu, 11 May 2023 15:23:21 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 11/05/2023 14:02, Michal Orzel wrote:
IRQ is of unsigned type so %u should be used. When printing domain id,
%pd should be the correct format to maintain the consistency.

Also, wherever possible, reduce the number of splitted lines for printk().

Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
Reviewed-by: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
---
Changes in v2:
  - split the v1 patch so that the format specifiers are handled separately
  - also fix map_irq_to_domain()
---
  xen/arch/arm/domain_build.c | 14 +++++---------
  1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 9dee1bb8f21c..71f307a572e9 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -2265,8 +2265,7 @@ int __init map_irq_to_domain(struct domain *d, unsigned 
int irq,
      res = irq_permit_access(d, irq);
      if ( res )
      {
-        printk(XENLOG_ERR "Unable to permit to dom%u access to IRQ %u\n",
-               d->domain_id, irq);
+        printk(XENLOG_ERR "Unable to permit to %pd access to IRQ %u\n", d, 
irq);
          return res;
      }
@@ -2282,8 +2281,7 @@ int __init map_irq_to_domain(struct domain *d, unsigned int irq,
          res = route_irq_to_guest(d, irq, irq, devname);
          if ( res < 0 )
          {
-            printk(XENLOG_ERR "Unable to map IRQ%"PRId32" to dom%d\n",
-                   irq, d->domain_id);
+            printk(XENLOG_ERR "Unable to map IRQ%u to %pd\n", irq, d);
              return res;
          }
      }
@@ -2303,8 +2301,7 @@ static int __init map_dt_irq_to_domain(const struct 
dt_device_node *dev,
if ( irq < NR_LOCAL_IRQS )
      {
-        printk(XENLOG_ERR "%s: IRQ%"PRId32" is not a SPI\n",
-               dt_node_name(dev), irq);
+        printk(XENLOG_ERR "%s: IRQ%u is not a SPI\n", dt_node_name(dev), irq);
          return -EINVAL;
      }
@@ -2312,9 +2309,8 @@ static int __init map_dt_irq_to_domain(const struct dt_device_node *dev,
      res = irq_set_spi_type(irq, dt_irq->type);
      if ( res )
      {
-        printk(XENLOG_ERR
-               "%s: Unable to setup IRQ%"PRId32" to dom%d\n",
-               dt_node_name(dev), irq, d->domain_id);
+        printk(XENLOG_ERR "%s: Unable to setup IRQ%u to %pd\n",
+               dt_node_name(dev), irq, d);
          return res;
      }



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.