iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iommu/arm-smmu: Axe a useless test in 'arm_smmu_master_alloc_smes()'
@ 2019-09-15 19:34 Christophe JAILLET
  2019-09-16 10:46 ` Robin Murphy
  0 siblings, 1 reply; 3+ messages in thread
From: Christophe JAILLET @ 2019-09-15 19:34 UTC (permalink / raw)
  To: will, robin.murphy, joro
  Cc: Christophe JAILLET, iommu, kernel-janitors, linux-kernel,
	linux-arm-kernel

'ommu_group_get_for_dev()' never returns NULL, so this test can be removed.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/iommu/arm-smmu.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index c3ef0cc8f764..6fae8cdbe985 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -1038,8 +1038,6 @@ static int arm_smmu_master_alloc_smes(struct device *dev)
 	}
 
 	group = iommu_group_get_for_dev(dev);
-	if (!group)
-		group = ERR_PTR(-ENOMEM);
 	if (IS_ERR(group)) {
 		ret = PTR_ERR(group);
 		goto out_err;
-- 
2.20.1

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

* Re: [PATCH] iommu/arm-smmu: Axe a useless test in 'arm_smmu_master_alloc_smes()'
  2019-09-15 19:34 [PATCH] iommu/arm-smmu: Axe a useless test in 'arm_smmu_master_alloc_smes()' Christophe JAILLET
@ 2019-09-16 10:46 ` Robin Murphy
  2019-09-16 19:43   ` Christophe JAILLET
  0 siblings, 1 reply; 3+ messages in thread
From: Robin Murphy @ 2019-09-16 10:46 UTC (permalink / raw)
  To: Christophe JAILLET, will, joro
  Cc: iommu, kernel-janitors, linux-kernel, linux-arm-kernel

On 15/09/2019 20:34, Christophe JAILLET wrote:
> 'ommu_group_get_for_dev()' never returns NULL, so this test can be removed.

Nit: typo in the function name.

Otherwise, there definitely used to be some path where a NULL return 
could leak out, so I would have had that in mind at the time I wrote 
this, but apparently I never noticed that that had already been cleaned 
up by the time this got merged.

Reviewed-by: Robin Murphy <robin.murphy@arm.com>

Thanks,
Robin.

> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>   drivers/iommu/arm-smmu.c | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
> index c3ef0cc8f764..6fae8cdbe985 100644
> --- a/drivers/iommu/arm-smmu.c
> +++ b/drivers/iommu/arm-smmu.c
> @@ -1038,8 +1038,6 @@ static int arm_smmu_master_alloc_smes(struct device *dev)
>   	}
>   
>   	group = iommu_group_get_for_dev(dev);
> -	if (!group)
> -		group = ERR_PTR(-ENOMEM);
>   	if (IS_ERR(group)) {
>   		ret = PTR_ERR(group);
>   		goto out_err;
> 
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

* Re: [PATCH] iommu/arm-smmu: Axe a useless test in 'arm_smmu_master_alloc_smes()'
  2019-09-16 10:46 ` Robin Murphy
@ 2019-09-16 19:43   ` Christophe JAILLET
  0 siblings, 0 replies; 3+ messages in thread
From: Christophe JAILLET @ 2019-09-16 19:43 UTC (permalink / raw)
  To: Robin Murphy, will, joro
  Cc: iommu, kernel-janitors, linux-kernel, linux-arm-kernel

Le 16/09/2019 à 12:46, Robin Murphy a écrit :
> On 15/09/2019 20:34, Christophe JAILLET wrote:
>> 'ommu_group_get_for_dev()' never returns NULL, so this test can be 
>> removed.
>
> Nit: typo in the function name.
>
> Otherwise, there definitely used to be some path where a NULL return 
> could leak out, so I would have had that in mind at the time I wrote 
> this, but apparently I never noticed that that had already been 
> cleaned up by the time this got merged.
>
Hi,

Maybe fixed by 72dcac633475 ("iommu: Warn once when device_group 
callback returns NULL")


CJ

> Reviewed-by: Robin Murphy <robin.murphy@arm.com>
>
> Thanks,
> Robin.
>
>> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>> ---
>>   drivers/iommu/arm-smmu.c | 2 --
>>   1 file changed, 2 deletions(-)
>>
>> diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
>> index c3ef0cc8f764..6fae8cdbe985 100644
>> --- a/drivers/iommu/arm-smmu.c
>> +++ b/drivers/iommu/arm-smmu.c
>> @@ -1038,8 +1038,6 @@ static int arm_smmu_master_alloc_smes(struct 
>> device *dev)
>>       }
>>         group = iommu_group_get_for_dev(dev);
>> -    if (!group)
>> -        group = ERR_PTR(-ENOMEM);
>>       if (IS_ERR(group)) {
>>           ret = PTR_ERR(group);
>>           goto out_err;
>>
>

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

end of thread, other threads:[~2019-09-16 19:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-15 19:34 [PATCH] iommu/arm-smmu: Axe a useless test in 'arm_smmu_master_alloc_smes()' Christophe JAILLET
2019-09-16 10:46 ` Robin Murphy
2019-09-16 19:43   ` Christophe JAILLET

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