linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] iommu/amd: Add default branch in amd_iommu_capable()
@ 2018-10-08  2:24 Lu Baolu
  2018-10-08 14:46 ` Joerg Roedel
  0 siblings, 1 reply; 2+ messages in thread
From: Lu Baolu @ 2018-10-08  2:24 UTC (permalink / raw)
  To: Joerg Roedel; +Cc: iommu, linux-kernel, 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.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
---
 drivers/iommu/amd_iommu.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index bee0dfb7b93b..1167ff0416cf 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -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;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] iommu/amd: Add default branch in amd_iommu_capable()
  2018-10-08  2:24 [PATCH 1/1] iommu/amd: Add default branch in amd_iommu_capable() Lu Baolu
@ 2018-10-08 14:46 ` Joerg Roedel
  0 siblings, 0 replies; 2+ messages in thread
From: Joerg Roedel @ 2018-10-08 14:46 UTC (permalink / raw)
  To: Lu Baolu; +Cc: iommu, linux-kernel

On Mon, Oct 08, 2018 at 10:24:19AM +0800, Lu Baolu wrote:
> 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.
> 
> Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
> ---
>  drivers/iommu/amd_iommu.c | 2 ++
>  1 file changed, 2 insertions(+)

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-10-08 14:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-08  2:24 [PATCH 1/1] iommu/amd: Add default branch in amd_iommu_capable() Lu Baolu
2018-10-08 14:46 ` Joerg Roedel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).