Skip to contentSkip to conversation

iommu/amd: Add default branch in amd_iommu_capable()

PATCH Applied Lu Baolu 2 participants 2 messages Oct 8, 2018 IOMMU

lore
Share & tools
lore

Lu Baolu

author
#0 lore raw

PATCH 1/1 iommu/amd: Add default branch in amd_iommu_capable()

Recent gcc warns about switching on an enumeration, but not having an explicit case statement for all members of the enumeration. To show the compiler this is intentional, we simply add a default case with nothing more than a break statement.

---
 drivers/iommu/amd_iommu.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/iommu/amd_iommu.c +2 -0
index bee0dfb7b93b..1167ff0416cf 100644
@@ -3083,6 +3083,8 @@ static bool amd_iommu_capable(enum iommu_cap cap)
 		return (irq_remapping_enabled == 1);
 	case IOMMU_CAP_NOEXEC:
 		return false;
+	default:
+		break;
 	}
 
 	return false;
Signature · 1 line
2.17.1
maintainer Applied
#1 lore raw
Quoted 9 lines · Lu Baolu

Recent gcc warns about switching on an enumeration, but not having an explicit case statement for all members of the enumeration. To show the compiler this is intentional, we simply add a default case with nothing more than a break statement.

---
 drivers/iommu/amd_iommu.c | 2 ++
 1 file changed, 2 insertions(+)

Applied, thanks.