Linux IOMMU Development
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: Anders Roxell <anders.roxell@linaro.org>,
	will@kernel.org, joro@8bytes.org
Cc: linux-arm-kernel@lists.infradead.org,
	iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH] iommu: arm-smmu-v3: Mark expected switch fall-through
Date: Fri, 26 Jul 2019 13:01:02 +0100	[thread overview]
Message-ID: <522507e5-96e6-2bf4-cf91-73963a77358d@arm.com> (raw)
In-Reply-To: <20190726112821.19775-1-anders.roxell@linaro.org>

On 26/07/2019 12:28, Anders Roxell wrote:
> When fall-through warnings was enabled by default, commit d93512ef0f0e

That commit ID only exists in a handful of old linux-next tags.

> ("Makefile: Globally enable fall-through warning"), the following
> warning was starting to show 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()' when disable_bypass is set, and always
> 'break;'
> 
> Cc: stable@vger.kernel.org # v4.2+
> Fixes: 5bc0a11664e1 ("iommu/arm-smmu: Don't BUG() if we find aborting STEs with disable_bypass")

Why? There's no actual bug, and not even current kernels have that 
warning enabled.

> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
> ---
>   drivers/iommu/arm-smmu-v3.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
> index a9a9fabd3968..8e5f0565996d 100644
> --- a/drivers/iommu/arm-smmu-v3.c
> +++ b/drivers/iommu/arm-smmu-v3.c
> @@ -1186,8 +1186,9 @@ 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;
> +			if (!disable_bypass)
> +				BUG();

You may as well just use BUG_ON().

Robin.

> +			break;
>   		default:
>   			BUG(); /* STE corruption */
>   		}
> 
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

      reply	other threads:[~2019-07-26 12:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-26 11:28 [PATCH] iommu: arm-smmu-v3: Mark expected switch fall-through Anders Roxell
2019-07-26 12:01 ` Robin Murphy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=522507e5-96e6-2bf4-cf91-73963a77358d@arm.com \
    --to=robin.murphy@arm.com \
    --cc=anders.roxell@linaro.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox