Skip to content

Commit

Permalink
iommu/vt-d: Remove redundant assignment to variable agaw
Browse files Browse the repository at this point in the history
The variable agaw is initialized with a value that is never read and it
is being updated later with a new value as a counter in a for-loop. The
initialization is redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Link: https://lore.kernel.org/r/20210416171826.64091-1-colin.king@canonical.com
Link: https://lore.kernel.org/r/20210610020115.1637656-2-baolu.lu@linux.intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
  • Loading branch information
Colin Ian King authored and Joerg Roedel committed Jun 10, 2021
1 parent 8124c8a commit 05d2cbf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/iommu/intel/iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ static inline int domain_pfn_supported(struct dmar_domain *domain,
static int __iommu_calculate_agaw(struct intel_iommu *iommu, int max_gaw)
{
unsigned long sagaw;
int agaw = -1;
int agaw;

sagaw = cap_sagaw(iommu->cap);
for (agaw = width_to_agaw(max_gaw);
Expand Down

0 comments on commit 05d2cbf

Please sign in to comment.