[PATCH] iommu/arm-smmu: Remove dev_err_probe() if error is -ENOMEM

Xichao Zhao posted 1 patch 1 month, 1 week ago
drivers/iommu/arm/arm-smmu/arm-smmu.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
[PATCH] iommu/arm-smmu: Remove dev_err_probe() if error is -ENOMEM
Posted by Xichao Zhao 1 month, 1 week ago
The dev_err_probe() doesn't do anything when error is '-ENOMEM'.
Therefore, remove the useless call to dev_err_probe(), and just
return the value instead.

Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
---
 drivers/iommu/arm/arm-smmu/arm-smmu.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c
index 4ced4b5bee4d..9e441f3a75d5 100644
--- a/drivers/iommu/arm/arm-smmu/arm-smmu.c
+++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c
@@ -2164,8 +2164,7 @@ static int arm_smmu_device_probe(struct platform_device *pdev)
 	smmu->irqs = devm_kcalloc(dev, smmu->num_context_irqs,
 				  sizeof(*smmu->irqs), GFP_KERNEL);
 	if (!smmu->irqs)
-		return dev_err_probe(dev, -ENOMEM, "failed to allocate %d irqs\n",
-				     smmu->num_context_irqs);
+		return -ENOMEM;
 
 	for (i = 0; i < smmu->num_context_irqs; i++) {
 		int irq = platform_get_irq(pdev, global_irqs + pmu_irqs + i);
-- 
2.34.1
Re: [PATCH] iommu/arm-smmu: Remove dev_err_probe() if error is -ENOMEM
Posted by Daniel Mentz 1 month, 1 week ago
On Thu, Aug 21, 2025 at 2:48 AM Xichao Zhao <zhao.xichao@vivo.com> wrote:
>
> The dev_err_probe() doesn't do anything when error is '-ENOMEM'.
> Therefore, remove the useless call to dev_err_probe(), and just
> return the value instead.

You could mention the following commit which I believe changed the
-ENOMEM behavior.

2f3cfd2f4b7c ("driver core: Make dev_err_probe() silent for -ENOMEM")
Re: [PATCH] iommu/arm-smmu: Remove dev_err_probe() if error is -ENOMEM
Posted by Will Deacon 3 weeks, 3 days ago
On Tue, Aug 26, 2025 at 09:39:26AM -0700, Daniel Mentz wrote:
> On Thu, Aug 21, 2025 at 2:48 AM Xichao Zhao <zhao.xichao@vivo.com> wrote:
> >
> > The dev_err_probe() doesn't do anything when error is '-ENOMEM'.
> > Therefore, remove the useless call to dev_err_probe(), and just
> > return the value instead.
> 
> You could mention the following commit which I believe changed the
> -ENOMEM behavior.
> 
> 2f3cfd2f4b7c ("driver core: Make dev_err_probe() silent for -ENOMEM")

Hmm, right, and now we lost the message about interrupts altogether so,
if anything, I'd be inclined to go back to the old behaviour prior to
97dfad194ca8 ("iommu/arm-smmu: Account for PMU interrupts") using
dev_err() and return -ENOMEM explicitly.

Will