linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: sdhci-xenon: Mark expected switch fall-through
@ 2019-02-12 15:25 Gustavo A. R. Silva
  2019-02-13  8:35 ` Ulf Hansson
  0 siblings, 1 reply; 5+ messages in thread
From: Gustavo A. R. Silva @ 2019-02-12 15:25 UTC (permalink / raw)
  To: Adrian Hunter, Hu Ziji, Ulf Hansson
  Cc: linux-mmc, linux-kernel, Gustavo A. R. Silva, Kees Cook

In preparation to enabling -Wimplicit-fallthrough, mark switch
cases where we are expecting to fall through.

This patch fixes the following warning:

drivers/mmc/host/sdhci-xenon-phy.c: In function ‘xenon_emmc_phy_slow_mode’:
drivers/mmc/host/sdhci-xenon-phy.c:527:47: warning: this statement may fall through [-Wimplicit-fallthrough=]
   if ((priv->init_card_type == MMC_TYPE_SDIO) ||
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
       params->slow_mode) {
       ~~~~~~~~~~~~~~~~~
drivers/mmc/host/sdhci-xenon-phy.c:534:2: note: here
  default:
  ^~~~~~~

Warning level 3 was used: -Wimplicit-fallthrough=3

Notice that, in this particular case, the code comment is modified
in accordance with what GCC is expecting to find.

This patch is part of the ongoing efforts to enable
-Wimplicit-fallthrough.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/mmc/host/sdhci-xenon-phy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci-xenon-phy.c b/drivers/mmc/host/sdhci-xenon-phy.c
index 5b5eb53a63d2..8d07ee1b8f08 100644
--- a/drivers/mmc/host/sdhci-xenon-phy.c
+++ b/drivers/mmc/host/sdhci-xenon-phy.c
@@ -530,7 +530,7 @@ static bool xenon_emmc_phy_slow_mode(struct sdhci_host *host,
 			ret = true;
 			break;
 		}
-		/* else: fall through */
+		/* fall through */
 	default:
 		reg &= ~XENON_TIMING_ADJUST_SLOW_MODE;
 		ret = false;
-- 
2.20.1


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

* Re: [PATCH] mmc: sdhci-xenon: Mark expected switch fall-through
  2019-02-12 15:25 [PATCH] mmc: sdhci-xenon: Mark expected switch fall-through Gustavo A. R. Silva
@ 2019-02-13  8:35 ` Ulf Hansson
  2019-02-13 18:13   ` Gustavo A. R. Silva
  0 siblings, 1 reply; 5+ messages in thread
From: Ulf Hansson @ 2019-02-13  8:35 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Adrian Hunter, Hu Ziji, linux-mmc, Linux Kernel Mailing List, Kees Cook

On Tue, 12 Feb 2019 at 16:26, Gustavo A. R. Silva
<gustavo@embeddedor.com> wrote:
>
> In preparation to enabling -Wimplicit-fallthrough, mark switch
> cases where we are expecting to fall through.
>
> This patch fixes the following warning:
>
> drivers/mmc/host/sdhci-xenon-phy.c: In function ‘xenon_emmc_phy_slow_mode’:
> drivers/mmc/host/sdhci-xenon-phy.c:527:47: warning: this statement may fall through [-Wimplicit-fallthrough=]
>    if ((priv->init_card_type == MMC_TYPE_SDIO) ||
>        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
>        params->slow_mode) {
>        ~~~~~~~~~~~~~~~~~
> drivers/mmc/host/sdhci-xenon-phy.c:534:2: note: here
>   default:
>   ^~~~~~~
>
> Warning level 3 was used: -Wimplicit-fallthrough=3
>
> Notice that, in this particular case, the code comment is modified
> in accordance with what GCC is expecting to find.
>
> This patch is part of the ongoing efforts to enable
> -Wimplicit-fallthrough.
>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>

Applied for next - and by cleaning up the somewhat noisy change log, thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/host/sdhci-xenon-phy.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/sdhci-xenon-phy.c b/drivers/mmc/host/sdhci-xenon-phy.c
> index 5b5eb53a63d2..8d07ee1b8f08 100644
> --- a/drivers/mmc/host/sdhci-xenon-phy.c
> +++ b/drivers/mmc/host/sdhci-xenon-phy.c
> @@ -530,7 +530,7 @@ static bool xenon_emmc_phy_slow_mode(struct sdhci_host *host,
>                         ret = true;
>                         break;
>                 }
> -               /* else: fall through */
> +               /* fall through */
>         default:
>                 reg &= ~XENON_TIMING_ADJUST_SLOW_MODE;
>                 ret = false;
> --
> 2.20.1
>

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

* Re: [PATCH] mmc: sdhci-xenon: Mark expected switch fall-through
  2019-02-13  8:35 ` Ulf Hansson
@ 2019-02-13 18:13   ` Gustavo A. R. Silva
  0 siblings, 0 replies; 5+ messages in thread
From: Gustavo A. R. Silva @ 2019-02-13 18:13 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Adrian Hunter, Hu Ziji, linux-mmc, Linux Kernel Mailing List, Kees Cook



On 2/13/19 2:35 AM, Ulf Hansson wrote:
> On Tue, 12 Feb 2019 at 16:26, Gustavo A. R. Silva
> <gustavo@embeddedor.com> wrote:
>>
>> In preparation to enabling -Wimplicit-fallthrough, mark switch
>> cases where we are expecting to fall through.
>>
>> This patch fixes the following warning:
>>
>> drivers/mmc/host/sdhci-xenon-phy.c: In function ‘xenon_emmc_phy_slow_mode’:
>> drivers/mmc/host/sdhci-xenon-phy.c:527:47: warning: this statement may fall through [-Wimplicit-fallthrough=]
>>    if ((priv->init_card_type == MMC_TYPE_SDIO) ||
>>        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
>>        params->slow_mode) {
>>        ~~~~~~~~~~~~~~~~~
>> drivers/mmc/host/sdhci-xenon-phy.c:534:2: note: here
>>   default:
>>   ^~~~~~~
>>
>> Warning level 3 was used: -Wimplicit-fallthrough=3
>>
>> Notice that, in this particular case, the code comment is modified
>> in accordance with what GCC is expecting to find.
>>
>> This patch is part of the ongoing efforts to enable
>> -Wimplicit-fallthrough.
>>
>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> 
> Applied for next - and by cleaning up the somewhat noisy change log, thanks!
> 

Great.

Thanks, Uffe.

--
Gustavo

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

* Re: [PATCH] mmc: sdhci-xenon: mark expected switch fall-through
  2018-07-03 22:56 [PATCH] mmc: sdhci-xenon: mark " Gustavo A. R. Silva
@ 2018-07-05 13:09 ` Ulf Hansson
  0 siblings, 0 replies; 5+ messages in thread
From: Ulf Hansson @ 2018-07-05 13:09 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Adrian Hunter, Hu Ziji, linux-mmc, Linux Kernel Mailing List

On 4 July 2018 at 00:56, Gustavo A. R. Silva <gustavo@embeddedor.com> wrote:
> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
> where we are expecting to fall through.
>
> Warning level 2 was used: -Wimplicit-fallthrough=2
>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>

Thanks, applied for next!

Kind regards
Uffe

> ---
>  drivers/mmc/host/sdhci-xenon-phy.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/mmc/host/sdhci-xenon-phy.c b/drivers/mmc/host/sdhci-xenon-phy.c
> index a35804b..c335052 100644
> --- a/drivers/mmc/host/sdhci-xenon-phy.c
> +++ b/drivers/mmc/host/sdhci-xenon-phy.c
> @@ -526,6 +526,7 @@ static bool xenon_emmc_phy_slow_mode(struct sdhci_host *host,
>                         ret = true;
>                         break;
>                 }
> +               /* else: fall through */
>         default:
>                 reg &= ~XENON_TIMING_ADJUST_SLOW_MODE;
>                 ret = false;
> --
> 2.7.4
>

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

* [PATCH] mmc: sdhci-xenon: mark expected switch fall-through
@ 2018-07-03 22:56 Gustavo A. R. Silva
  2018-07-05 13:09 ` Ulf Hansson
  0 siblings, 1 reply; 5+ messages in thread
From: Gustavo A. R. Silva @ 2018-07-03 22:56 UTC (permalink / raw)
  To: Adrian Hunter, Hu Ziji, Ulf Hansson
  Cc: linux-mmc, linux-kernel, Gustavo A. R. Silva

In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Warning level 2 was used: -Wimplicit-fallthrough=2

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/mmc/host/sdhci-xenon-phy.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mmc/host/sdhci-xenon-phy.c b/drivers/mmc/host/sdhci-xenon-phy.c
index a35804b..c335052 100644
--- a/drivers/mmc/host/sdhci-xenon-phy.c
+++ b/drivers/mmc/host/sdhci-xenon-phy.c
@@ -526,6 +526,7 @@ static bool xenon_emmc_phy_slow_mode(struct sdhci_host *host,
 			ret = true;
 			break;
 		}
+		/* else: fall through */
 	default:
 		reg &= ~XENON_TIMING_ADJUST_SLOW_MODE;
 		ret = false;
-- 
2.7.4


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

end of thread, other threads:[~2019-02-13 18:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-12 15:25 [PATCH] mmc: sdhci-xenon: Mark expected switch fall-through Gustavo A. R. Silva
2019-02-13  8:35 ` Ulf Hansson
2019-02-13 18:13   ` Gustavo A. R. Silva
  -- strict thread matches above, loose matches on Subject: below --
2018-07-03 22:56 [PATCH] mmc: sdhci-xenon: mark " Gustavo A. R. Silva
2018-07-05 13:09 ` Ulf Hansson

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).