]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
iommu/vt-d: Remove redundant assignment to variable err
authorColin Ian King <colin.i.king@gmail.com>
Wed, 24 Apr 2024 07:16:27 +0000 (15:16 +0800)
committerJoerg Roedel <jroedel@suse.de>
Fri, 26 Apr 2024 09:57:35 +0000 (11:57 +0200)
Variable err is being assigned a value that is never read. It is
either being re-assigned later on error exit paths, or never referenced
on the non-error path.

Cleans up clang scan build warning:
drivers/iommu/intel/dmar.c:1070:2: warning: Value stored to 'err' is
never read [deadcode.DeadStores]`

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/r/20240411090535.306326-1-colin.i.king@gmail.com
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/intel/dmar.c

index 36d7427b12026ca943e3beb660e2866e19e687a1..351be945521468fdc583bcff03ce606cde1e839c 100644 (file)
@@ -1067,7 +1067,6 @@ static int alloc_iommu(struct dmar_drhd_unit *drhd)
                goto error_free_seq_id;
        }
 
-       err = -EINVAL;
        if (!cap_sagaw(iommu->cap) &&
            (!ecap_smts(iommu->ecap) || ecap_slts(iommu->ecap))) {
                pr_info("%s: No supported address widths. Not attempting DMA translation.\n",