[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d9e17a6f-a8f3-4272-91b6-0ee7e7808c8c@stanley.mountain>
Date: Mon, 17 Mar 2025 09:43:08 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Joerg Roedel <joro@...tes.org>
Cc: Suravee Suthikulpanit <suravee.suthikulpanit@....com>,
Will Deacon <will@...nel.org>, Robin Murphy <robin.murphy@....com>,
iommu@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: [PATCH 1/2] iommu/amd: Delete unnecessary NULL check
The "iommu" pointer is always valid at this point so there is no
need to check for NULL. Checking for NULL triggers a Smatch warning
because it's dereferenced without a check a couple lines later:
drivers/iommu/amd/iommu.c:3200 alloc_irq_table()
error: we previously assumed 'iommu' could be null (see line 3195)
Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
---
drivers/iommu/amd/iommu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
index be8761bbef0f..ce2626801ddf 100644
--- a/drivers/iommu/amd/iommu.c
+++ b/drivers/iommu/amd/iommu.c
@@ -3192,7 +3192,7 @@ static struct irq_remap_table *alloc_irq_table(struct amd_iommu *iommu,
struct amd_iommu_pci_seg *pci_seg;
unsigned long flags;
int order = get_order(get_irq_table_size(max_irqs));
- int nid = iommu && iommu->dev ? dev_to_node(&iommu->dev->dev) : NUMA_NO_NODE;
+ int nid = iommu->dev ? dev_to_node(&iommu->dev->dev) : NUMA_NO_NODE;
u16 alias;
spin_lock_irqsave(&iommu_table_lock, flags);
--
2.47.2
Powered by blists - more mailing lists