All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] iommu: arm-smmu-v3: Mark expected switch fall-through
@ 2019-07-30 15:20 ` Anders Roxell
  0 siblings, 0 replies; 9+ messages in thread
From: Anders Roxell @ 2019-07-30 15:20 UTC (permalink / raw)
  To: will, joro
  Cc: linux-arm-kernel, iommu, linux-kernel, robin.murphy, Anders Roxell

Now that -Wimplicit-fallthrough is passed to GCC by default, the
following warning shows up:

../drivers/iommu/arm-smmu-v3.c: In function ‘arm_smmu_write_strtab_ent’:
../drivers/iommu/arm-smmu-v3.c:1189:7: warning: this statement may fall
 through [-Wimplicit-fallthrough=]
    if (disable_bypass)
       ^
../drivers/iommu/arm-smmu-v3.c:1191:3: note: here
   default:
   ^~~~~~~

Rework so that the compiler doesn't warn about fall-through. Make it
clearer by calling 'BUG_ON()' when disable_bypass is set, and always
'break;'

Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 drivers/iommu/arm-smmu-v3.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
index a9a9fabd3968..c5c93e48b4db 100644
--- a/drivers/iommu/arm-smmu-v3.c
+++ b/drivers/iommu/arm-smmu-v3.c
@@ -1186,8 +1186,8 @@ static void arm_smmu_write_strtab_ent(struct arm_smmu_master *master, u32 sid,
 			ste_live = true;
 			break;
 		case STRTAB_STE_0_CFG_ABORT:
-			if (disable_bypass)
-				break;
+			BUG_ON(!disable_bypass);
+			break;
 		default:
 			BUG(); /* STE corruption */
 		}
-- 
2.20.1


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

* [PATCH v2] iommu: arm-smmu-v3: Mark expected switch fall-through
@ 2019-07-30 15:20 ` Anders Roxell
  0 siblings, 0 replies; 9+ messages in thread
From: Anders Roxell @ 2019-07-30 15:20 UTC (permalink / raw)
  To: will, joro
  Cc: Anders Roxell, iommu, robin.murphy, linux-kernel, linux-arm-kernel

Now that -Wimplicit-fallthrough is passed to GCC by default, the
following warning shows up:

../drivers/iommu/arm-smmu-v3.c: In function ‘arm_smmu_write_strtab_ent’:
../drivers/iommu/arm-smmu-v3.c:1189:7: warning: this statement may fall
 through [-Wimplicit-fallthrough=]
    if (disable_bypass)
       ^
../drivers/iommu/arm-smmu-v3.c:1191:3: note: here
   default:
   ^~~~~~~

Rework so that the compiler doesn't warn about fall-through. Make it
clearer by calling 'BUG_ON()' when disable_bypass is set, and always
'break;'

Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 drivers/iommu/arm-smmu-v3.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
index a9a9fabd3968..c5c93e48b4db 100644
--- a/drivers/iommu/arm-smmu-v3.c
+++ b/drivers/iommu/arm-smmu-v3.c
@@ -1186,8 +1186,8 @@ static void arm_smmu_write_strtab_ent(struct arm_smmu_master *master, u32 sid,
 			ste_live = true;
 			break;
 		case STRTAB_STE_0_CFG_ABORT:
-			if (disable_bypass)
-				break;
+			BUG_ON(!disable_bypass);
+			break;
 		default:
 			BUG(); /* STE corruption */
 		}
-- 
2.20.1

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

* [PATCH v2] iommu: arm-smmu-v3: Mark expected switch fall-through
@ 2019-07-30 15:20 ` Anders Roxell
  0 siblings, 0 replies; 9+ messages in thread
From: Anders Roxell @ 2019-07-30 15:20 UTC (permalink / raw)
  To: will, joro
  Cc: Anders Roxell, iommu, robin.murphy, linux-kernel, linux-arm-kernel

Now that -Wimplicit-fallthrough is passed to GCC by default, the
following warning shows up:

../drivers/iommu/arm-smmu-v3.c: In function ‘arm_smmu_write_strtab_ent’:
../drivers/iommu/arm-smmu-v3.c:1189:7: warning: this statement may fall
 through [-Wimplicit-fallthrough=]
    if (disable_bypass)
       ^
../drivers/iommu/arm-smmu-v3.c:1191:3: note: here
   default:
   ^~~~~~~

Rework so that the compiler doesn't warn about fall-through. Make it
clearer by calling 'BUG_ON()' when disable_bypass is set, and always
'break;'

Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 drivers/iommu/arm-smmu-v3.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
index a9a9fabd3968..c5c93e48b4db 100644
--- a/drivers/iommu/arm-smmu-v3.c
+++ b/drivers/iommu/arm-smmu-v3.c
@@ -1186,8 +1186,8 @@ static void arm_smmu_write_strtab_ent(struct arm_smmu_master *master, u32 sid,
 			ste_live = true;
 			break;
 		case STRTAB_STE_0_CFG_ABORT:
-			if (disable_bypass)
-				break;
+			BUG_ON(!disable_bypass);
+			break;
 		default:
 			BUG(); /* STE corruption */
 		}
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2] iommu: arm-smmu-v3: Mark expected switch fall-through
  2019-07-30 15:20 ` Anders Roxell
  (?)
@ 2019-07-30 15:26   ` Will Deacon
  -1 siblings, 0 replies; 9+ messages in thread
From: Will Deacon @ 2019-07-30 15:26 UTC (permalink / raw)
  To: Anders Roxell; +Cc: joro, linux-arm-kernel, iommu, linux-kernel, robin.murphy

On Tue, Jul 30, 2019 at 05:20:11PM +0200, Anders Roxell wrote:
> Now that -Wimplicit-fallthrough is passed to GCC by default, the
> following warning shows up:
> 
> ../drivers/iommu/arm-smmu-v3.c: In function ‘arm_smmu_write_strtab_ent’:
> ../drivers/iommu/arm-smmu-v3.c:1189:7: warning: this statement may fall
>  through [-Wimplicit-fallthrough=]
>     if (disable_bypass)
>        ^
> ../drivers/iommu/arm-smmu-v3.c:1191:3: note: here
>    default:
>    ^~~~~~~
> 
> Rework so that the compiler doesn't warn about fall-through. Make it
> clearer by calling 'BUG_ON()' when disable_bypass is set, and always
> 'break;'
> 
> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
> ---
>  drivers/iommu/arm-smmu-v3.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
> index a9a9fabd3968..c5c93e48b4db 100644
> --- a/drivers/iommu/arm-smmu-v3.c
> +++ b/drivers/iommu/arm-smmu-v3.c
> @@ -1186,8 +1186,8 @@ static void arm_smmu_write_strtab_ent(struct arm_smmu_master *master, u32 sid,
>  			ste_live = true;
>  			break;
>  		case STRTAB_STE_0_CFG_ABORT:
> -			if (disable_bypass)
> -				break;
> +			BUG_ON(!disable_bypass);
> +			break;
>  		default:
>  			BUG(); /* STE corruption */
>  		}
> -- 
> 2.20.1

Acked-by: Will Deacon <will@kernel.org>

Joerg -- if you'd like to pick this up as a fix, feel free, otherwise I'll
include it in my pull request for 5.4.

Cheers,

Will

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

* Re: [PATCH v2] iommu: arm-smmu-v3: Mark expected switch fall-through
@ 2019-07-30 15:26   ` Will Deacon
  0 siblings, 0 replies; 9+ messages in thread
From: Will Deacon @ 2019-07-30 15:26 UTC (permalink / raw)
  To: Anders Roxell; +Cc: robin.murphy, iommu, linux-arm-kernel, linux-kernel

On Tue, Jul 30, 2019 at 05:20:11PM +0200, Anders Roxell wrote:
> Now that -Wimplicit-fallthrough is passed to GCC by default, the
> following warning shows up:
> 
> ../drivers/iommu/arm-smmu-v3.c: In function ‘arm_smmu_write_strtab_ent’:
> ../drivers/iommu/arm-smmu-v3.c:1189:7: warning: this statement may fall
>  through [-Wimplicit-fallthrough=]
>     if (disable_bypass)
>        ^
> ../drivers/iommu/arm-smmu-v3.c:1191:3: note: here
>    default:
>    ^~~~~~~
> 
> Rework so that the compiler doesn't warn about fall-through. Make it
> clearer by calling 'BUG_ON()' when disable_bypass is set, and always
> 'break;'
> 
> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
> ---
>  drivers/iommu/arm-smmu-v3.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
> index a9a9fabd3968..c5c93e48b4db 100644
> --- a/drivers/iommu/arm-smmu-v3.c
> +++ b/drivers/iommu/arm-smmu-v3.c
> @@ -1186,8 +1186,8 @@ static void arm_smmu_write_strtab_ent(struct arm_smmu_master *master, u32 sid,
>  			ste_live = true;
>  			break;
>  		case STRTAB_STE_0_CFG_ABORT:
> -			if (disable_bypass)
> -				break;
> +			BUG_ON(!disable_bypass);
> +			break;
>  		default:
>  			BUG(); /* STE corruption */
>  		}
> -- 
> 2.20.1

Acked-by: Will Deacon <will@kernel.org>

Joerg -- if you'd like to pick this up as a fix, feel free, otherwise I'll
include it in my pull request for 5.4.

Cheers,

Will
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

* Re: [PATCH v2] iommu: arm-smmu-v3: Mark expected switch fall-through
@ 2019-07-30 15:26   ` Will Deacon
  0 siblings, 0 replies; 9+ messages in thread
From: Will Deacon @ 2019-07-30 15:26 UTC (permalink / raw)
  To: Anders Roxell; +Cc: joro, robin.murphy, iommu, linux-arm-kernel, linux-kernel

On Tue, Jul 30, 2019 at 05:20:11PM +0200, Anders Roxell wrote:
> Now that -Wimplicit-fallthrough is passed to GCC by default, the
> following warning shows up:
> 
> ../drivers/iommu/arm-smmu-v3.c: In function ‘arm_smmu_write_strtab_ent’:
> ../drivers/iommu/arm-smmu-v3.c:1189:7: warning: this statement may fall
>  through [-Wimplicit-fallthrough=]
>     if (disable_bypass)
>        ^
> ../drivers/iommu/arm-smmu-v3.c:1191:3: note: here
>    default:
>    ^~~~~~~
> 
> Rework so that the compiler doesn't warn about fall-through. Make it
> clearer by calling 'BUG_ON()' when disable_bypass is set, and always
> 'break;'
> 
> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
> ---
>  drivers/iommu/arm-smmu-v3.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
> index a9a9fabd3968..c5c93e48b4db 100644
> --- a/drivers/iommu/arm-smmu-v3.c
> +++ b/drivers/iommu/arm-smmu-v3.c
> @@ -1186,8 +1186,8 @@ static void arm_smmu_write_strtab_ent(struct arm_smmu_master *master, u32 sid,
>  			ste_live = true;
>  			break;
>  		case STRTAB_STE_0_CFG_ABORT:
> -			if (disable_bypass)
> -				break;
> +			BUG_ON(!disable_bypass);
> +			break;
>  		default:
>  			BUG(); /* STE corruption */
>  		}
> -- 
> 2.20.1

Acked-by: Will Deacon <will@kernel.org>

Joerg -- if you'd like to pick this up as a fix, feel free, otherwise I'll
include it in my pull request for 5.4.

Cheers,

Will

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2] iommu: arm-smmu-v3: Mark expected switch fall-through
  2019-07-30 15:26   ` Will Deacon
  (?)
@ 2019-08-06 15:28     ` Joerg Roedel
  -1 siblings, 0 replies; 9+ messages in thread
From: Joerg Roedel @ 2019-08-06 15:28 UTC (permalink / raw)
  To: Will Deacon
  Cc: Anders Roxell, linux-arm-kernel, iommu, linux-kernel, robin.murphy

On Tue, Jul 30, 2019 at 04:26:01PM +0100, Will Deacon wrote:
> Joerg -- if you'd like to pick this up as a fix, feel free, otherwise I'll
> include it in my pull request for 5.4.

Applied to iommu/fixes, thanks.

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

* Re: [PATCH v2] iommu: arm-smmu-v3: Mark expected switch fall-through
@ 2019-08-06 15:28     ` Joerg Roedel
  0 siblings, 0 replies; 9+ messages in thread
From: Joerg Roedel @ 2019-08-06 15:28 UTC (permalink / raw)
  To: Will Deacon
  Cc: robin.murphy, iommu, Anders Roxell, linux-kernel, linux-arm-kernel

On Tue, Jul 30, 2019 at 04:26:01PM +0100, Will Deacon wrote:
> Joerg -- if you'd like to pick this up as a fix, feel free, otherwise I'll
> include it in my pull request for 5.4.

Applied to iommu/fixes, thanks.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

* Re: [PATCH v2] iommu: arm-smmu-v3: Mark expected switch fall-through
@ 2019-08-06 15:28     ` Joerg Roedel
  0 siblings, 0 replies; 9+ messages in thread
From: Joerg Roedel @ 2019-08-06 15:28 UTC (permalink / raw)
  To: Will Deacon
  Cc: robin.murphy, iommu, Anders Roxell, linux-kernel, linux-arm-kernel

On Tue, Jul 30, 2019 at 04:26:01PM +0100, Will Deacon wrote:
> Joerg -- if you'd like to pick this up as a fix, feel free, otherwise I'll
> include it in my pull request for 5.4.

Applied to iommu/fixes, thanks.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2019-08-06 15:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-30 15:20 [PATCH v2] iommu: arm-smmu-v3: Mark expected switch fall-through Anders Roxell
2019-07-30 15:20 ` Anders Roxell
2019-07-30 15:20 ` Anders Roxell
2019-07-30 15:26 ` Will Deacon
2019-07-30 15:26   ` Will Deacon
2019-07-30 15:26   ` Will Deacon
2019-08-06 15:28   ` Joerg Roedel
2019-08-06 15:28     ` Joerg Roedel
2019-08-06 15:28     ` Joerg Roedel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.