iommu/amd: remove compiler warning due to IOMMU_CAP_NOEXEC
authorWill Deacon <will.deacon@arm.com>
Mon, 27 Oct 2014 11:24:48 +0000 (11:24 +0000)
committerWill Deacon <will.deacon@arm.com>
Fri, 14 Nov 2014 14:41:39 +0000 (14:41 +0000)
Some versions of GCC get unduly upset when confronted with a switch
that doesn't explicitly handle all cases of an enum, despite having an
implicit default case following the actualy switch statement:

   drivers/iommu/amd_iommu.c: In function 'amd_iommu_capable':
>> drivers/iommu/amd_iommu.c:3409:2: warning: enumeration value 'IOMMU_CAP_NOEXEC' not handled in switch [-Wswitch]
     switch (cap) {

This patch adds a case for IOMMU_CAP_NOEXEC to the amd IOMMU driver to
remove this warning.

Cc: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Will Deacon <will.deacon@arm.com>
drivers/iommu/amd_iommu.c

index 505a9adac2d51f560617ae36c7a2f53a58f906b6..3d78a8fb5a6ac3fc0e7fff0c7da37787e13005b1 100644 (file)
@@ -3411,6 +3411,8 @@ static bool amd_iommu_capable(enum iommu_cap cap)
                return true;
        case IOMMU_CAP_INTR_REMAP:
                return (irq_remapping_enabled == 1);
+       case IOMMU_CAP_NOEXEC:
+               return false;
        }
 
        return false;