xen/arm: domain_build: map_{dt_}irq_to_domain() fixes
v2 cover xen/arm: domain_build: map_{dt_}irq_to_domain() fixes
Propagate return code correctly + fix the format specifiers.
Michal Orzel (2):
xen/arm: domain_build: Propagate return code of map_irq_to_domain() xen/arm: domain_build: Fix format specifiers in
map_{dt_}irq_to_domain()xen/arch/arm/domain_build.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-)
Signature · 1 line
2.25.1
PATCH v2 1/2 xen/arm: domain_build: Propagate return code of map_irq_to_domain()
From map_dt_irq_to_domain() we are assigning a return code of map_irq_to_domain() to a variable without checking it for an error. Fix it by propagating the return code directly since this is the last call.
---
Changes in v2:
- split the patch so that a fix alone can be backported
--- xen/arch/arm/domain_build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/arm/domain_build.c +1 -1
@@ -2320,7 +2320,7 @@ static int __init map_dt_irq_to_domain(const struct dt_device_node *dev, res =map_irq_to_domain (d, irq, !mr_data->skip_mapping,dt_node_name (dev)); -return 0 ; +return res; } int __init map_range_to_domain(const struct dt_device_node *dev,
Signature · 1 line
2.25.1
Re: [PATCH v2 1/2] xen/arm: domain_build: Propagate return code of map_irq_to_domain()
Quoted 7 lines · Michal Orzel
From
map_dt_irq_to_domain()we are assigning a return code ofmap_irq_to_domain()to a variable without checking it for an error. Fix it by propagating the return code directly since this is the last call.Fixes 467e5cbb2ffc ("xen: arm: consolidate mmio and irq mapping to dom0")Signed-off-by Michal Orzel <[email protected]>
Quoted 20 lines
---
Changes in v2:
- split the patch so that a fix alone can be backported--- xen/arch/arm/domain_build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)xen/arch/arm/domain_build.c +1
-1@@ -2320,7 +2320,7 @@ static int __init map_dt_irq_to_domain(const struct dt_device_node *dev, res =map_irq_to_domain (d, irq, !mr_data->skip_mapping,dt_node_name (dev)); -return 0 ; +return res; } int __init map_range_to_domain(const struct dt_device_node *dev,
RE: [PATCH v2 1/2] xen/arm: domain_build: Propagate return code of map_irq_to_domain()
In reply to Michal OrzelHi Michal,
Quoted 11 lines
-----Original Message-----
Subject: [PATCH v2 1/2] xen/arm:domain_build: Propagate return code ofmap_irq_to_domain()From
map_dt_irq_to_domain()we are assigning a return code ofmap_irq_to_domain()to a variable without checking it for an error. Fix it by propagating the return code directly since this is the last call.Fixes 467e5cbb2ffc ("xen: arm: consolidate mmio and irq mapping to dom0")Signed-off-by Michal Orzel <[email protected]>
Kind regards,
Henry
Re: [PATCH v2 1/2] xen/arm: domain_build: Propagate return code of map_irq_to_domain()
In reply to Michal OrzelHi Michal,
Quoted 7 lines · Michal Orzel
From
map_dt_irq_to_domain()we are assigning a return code ofmap_irq_to_domain()to a variable without checking it for an error. Fix it by propagating the return code directly since this is the last call.Fixes 467e5cbb2ffc ("xen: arm: consolidate mmio and irq mapping to dom0")Signed-off-by Michal Orzel <[email protected]>
Cheers,
Quoted 20 lines
---
Changes in v2:
- split the patch so that a fix alone can be backported--- xen/arch/arm/domain_build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)xen/arch/arm/domain_build.c +1
-1@@ -2320,7 +2320,7 @@ static int __init map_dt_irq_to_domain(const struct dt_device_node *dev, res =map_irq_to_domain (d, irq, !mr_data->skip_mapping,dt_node_name (dev)); -return 0 ; +return res; } int __init map_range_to_domain(const struct dt_device_node *dev,
Signature · 1 line
Julien Grall
PATCH v2 2/2 xen/arm: domain_build: Fix format specifiers in map_{dt_}irq_to_domain()
In reply to Michal OrzelIRQ 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().
---
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(-)
xen/arch/arm/domain_build.c +5 -9
@@ -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; }
Signature · 1 line
2.25.1
Re: [PATCH v2 2/2] xen/arm: domain_build: Fix format specifiers in map_{dt_}irq_to_domain()
Quoted 4 lines · Michal Orzel
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().
Very minor grammar note. Just "split" here.
~Andrew
Re: [PATCH v2 2/2] xen/arm: domain_build: Fix format specifiers in map_{dt_}irq_to_domain()
In reply to Michal OrzelQuoted 6 lines · Michal Orzel
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 <[email protected]>
Quoted 54 lines
---
Changes in v2:
- split the v1 patch so that the format specifiers are handled separately
- also fixmap_irq_to_domain()--- xen/arch/arm/domain_build.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)xen/arch/arm/domain_build.c +5
-9@@ -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; }
RE: [PATCH v2 2/2] xen/arm: domain_build: Fix format specifiers in map_{dt_}irq_to_domain()
In reply to Michal OrzelHi Michal,
Quoted 10 lines
-----Original Message-----
Subject: [PATCH v2 2/2] xen/arm:domain_build: Fix format specifiers in map_{dt_}irq_to_domain()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 <[email protected]>
Kind regards,
Henry
Re: [PATCH v2 2/2] xen/arm: domain_build: Fix format specifiers in map_{dt_}irq_to_domain()
In reply to Michal OrzelHi Michal,
Quoted 4 lines · Michal Orzel
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().
I will fix the typo pointed out by Andrew whilst committing the series.
Cheers,
Quoted 56 lines
Signed-off-by Michal Orzel <[email protected]>---
Changes in v2:
- split the v1 patch so that the format specifiers are handled separately
- also fixmap_irq_to_domain()--- xen/arch/arm/domain_build.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)xen/arch/arm/domain_build.c +5
-9@@ -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; }
Signature · 1 line
Julien Grall
Hi Michal,
Quoted 6 lines · Michal Orzel
Propagate return code correctly + fix the format specifiers.
Michal Orzel (2):
xen/arm:domain_build: Propagate return code ofmap_irq_to_domain()xen/arm:domain_build: Fix format specifiers inmap_{dt_}irq_to_domain()
I have committed the series.
Cheers,
Signature · 1 line
Julien Grall