diff mbox series

irqchip/gic-v3-its: Avoid parsing _indirect_ twice for Device table

Message ID 1549776250-4464-1-git-send-email-yuzenghui@huawei.com (mailing list archive)
State Mainlined, archived
Commit 8d565748b6035eeda18895c213396a4c9fac6a4c
Headers show
Series irqchip/gic-v3-its: Avoid parsing _indirect_ twice for Device table | expand

Commit Message

Zenghui Yu Feb. 10, 2019, 5:24 a.m. UTC
In current logic, its_parse_indirect_baser() will be invoked twice
when allocating Device tables. Add a *break* to omit the unnecessary
and annoying (might be ...) invoking.

Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>
---
 drivers/irqchip/irq-gic-v3-its.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Zenghui Yu Feb. 12, 2019, 1:17 p.m. UTC | #1
Hi Marc,

On 2019/2/10 13:24, Zenghui Yu wrote:
> In current logic, its_parse_indirect_baser() will be invoked twice
> when allocating Device tables. Add a *break* to omit the unnecessary
> and annoying (might be ...) invoking.
> 

Forgot to add:

Fixes: 32bd44dc19de ("irqchip/gic-v3-its: Fix the incorrect parsing of 
VCPU table size")

> Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>
> ---
>   drivers/irqchip/irq-gic-v3-its.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
> index db20e99..9f529a6 100644
> --- a/drivers/irqchip/irq-gic-v3-its.c
> +++ b/drivers/irqchip/irq-gic-v3-its.c
> @@ -1946,6 +1946,8 @@ static int its_alloc_tables(struct its_node *its)
>   			indirect = its_parse_indirect_baser(its, baser,
>   							    psz, &order,
>   							    its->device_ids);
> +			break;
> +
>   		case GITS_BASER_TYPE_VCPU:
>   			indirect = its_parse_indirect_baser(its, baser,
>   							    psz, &order,
> 

Thanks,
Zenghui
Marc Zyngier Feb. 14, 2019, 10:46 a.m. UTC | #2
On Sun, 10 Feb 2019 05:24:10 +0000,
Zenghui Yu <yuzenghui@huawei.com> wrote:
> 
> In current logic, its_parse_indirect_baser() will be invoked twice
> when allocating Device tables. Add a *break* to omit the unnecessary
> and annoying (might be ...) invoking.
> 
> Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>
> ---
>  drivers/irqchip/irq-gic-v3-its.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
> index db20e99..9f529a6 100644
> --- a/drivers/irqchip/irq-gic-v3-its.c
> +++ b/drivers/irqchip/irq-gic-v3-its.c
> @@ -1946,6 +1946,8 @@ static int its_alloc_tables(struct its_node *its)
>  			indirect = its_parse_indirect_baser(its, baser,
>  							    psz, &order,
>  							    its->device_ids);
> +			break;
> +
>  		case GITS_BASER_TYPE_VCPU:
>  			indirect = its_parse_indirect_baser(its, baser,
>  							    psz, &order,

Nice catch. I've applied this to irqchip-next with the Fixes tag and a
Cc stable.

Thanks,

	M.
Zenghui Yu Feb. 14, 2019, 11:35 a.m. UTC | #3
Hi Marc,

On 2019/2/14 18:46, Marc Zyngier wrote:
> On Sun, 10 Feb 2019 05:24:10 +0000,
> Zenghui Yu <yuzenghui@huawei.com> wrote:
>>
>> In current logic, its_parse_indirect_baser() will be invoked twice
>> when allocating Device tables. Add a *break* to omit the unnecessary
>> and annoying (might be ...) invoking.
>>
>> Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>
>> ---
>>   drivers/irqchip/irq-gic-v3-its.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
>> index db20e99..9f529a6 100644
>> --- a/drivers/irqchip/irq-gic-v3-its.c
>> +++ b/drivers/irqchip/irq-gic-v3-its.c
>> @@ -1946,6 +1946,8 @@ static int its_alloc_tables(struct its_node *its)
>>   			indirect = its_parse_indirect_baser(its, baser,
>>   							    psz, &order,
>>   							    its->device_ids);
>> +			break;
>> +
>>   		case GITS_BASER_TYPE_VCPU:
>>   			indirect = its_parse_indirect_baser(its, baser,
>>   							    psz, &order,
> 
> Nice catch. I've applied this to irqchip-next with the Fixes tag and a
> Cc stable.
> 

Thanks for picking it up!

Zenghui
diff mbox series

Patch

diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index db20e99..9f529a6 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -1946,6 +1946,8 @@  static int its_alloc_tables(struct its_node *its)
 			indirect = its_parse_indirect_baser(its, baser,
 							    psz, &order,
 							    its->device_ids);
+			break;
+
 		case GITS_BASER_TYPE_VCPU:
 			indirect = its_parse_indirect_baser(its, baser,
 							    psz, &order,