gpio: sprd: Add missing break in switch statement
diff mbox series

Message ID 20190211185001.GA19472@embeddedor
State Accepted
Commit 5340f23df8fe27a270af3fa1a93cd07293d23dd9
Headers show
Series
  • gpio: sprd: Add missing break in switch statement
Related show

Commit Message

Gustavo A. R. Silva Feb. 11, 2019, 6:50 p.m. UTC
Fix the following warning by adding a missing break:

drivers/gpio/gpio-eic-sprd.c: In function ‘sprd_eic_irq_set_type’:
drivers/gpio/gpio-eic-sprd.c:403:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
   switch (flow_type) {
   ^~~~~~
drivers/gpio/gpio-eic-sprd.c:435:2: note: here
  default:
  ^~~~~~~

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

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/gpio/gpio-eic-sprd.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Baolin Wang Feb. 12, 2019, 2:07 a.m. UTC | #1
Hi Gustavo,

On Tue, 12 Feb 2019 at 02:50, Gustavo A. R. Silva
<gustavo@embeddedor.com> wrote:
>
> Fix the following warning by adding a missing break:
>
> drivers/gpio/gpio-eic-sprd.c: In function ‘sprd_eic_irq_set_type’:
> drivers/gpio/gpio-eic-sprd.c:403:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
>    switch (flow_type) {
>    ^~~~~~
> drivers/gpio/gpio-eic-sprd.c:435:2: note: here
>   default:
>   ^~~~~~~
>
> This patch is part of the ongoing efforts to enable
> -Wimplicit-fallthrough.
>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>

Thanks for fixing my mistake.
Reviewed-by: Baolin Wang <baolin.wang@linaro.org>

> ---
>  drivers/gpio/gpio-eic-sprd.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpio/gpio-eic-sprd.c b/drivers/gpio/gpio-eic-sprd.c
> index e41223c05f6e..f0223cee9774 100644
> --- a/drivers/gpio/gpio-eic-sprd.c
> +++ b/drivers/gpio/gpio-eic-sprd.c
> @@ -432,6 +432,7 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type)
>                 default:
>                         return -ENOTSUPP;
>                 }
> +               break;
>         default:
>                 dev_err(chip->parent, "Unsupported EIC type.\n");
>                 return -ENOTSUPP;
> --
> 2.20.1
>
Gustavo A. R. Silva Feb. 12, 2019, 2:11 a.m. UTC | #2
Hi Baolin,

On 2/11/19 8:07 PM, Baolin Wang wrote:
> Hi Gustavo,
> 
> On Tue, 12 Feb 2019 at 02:50, Gustavo A. R. Silva
> <gustavo@embeddedor.com> wrote:
>>
>> Fix the following warning by adding a missing break:
>>
>> drivers/gpio/gpio-eic-sprd.c: In function ‘sprd_eic_irq_set_type’:
>> drivers/gpio/gpio-eic-sprd.c:403:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
>>    switch (flow_type) {
>>    ^~~~~~
>> drivers/gpio/gpio-eic-sprd.c:435:2: note: here
>>   default:
>>   ^~~~~~~
>>
>> This patch is part of the ongoing efforts to enable
>> -Wimplicit-fallthrough.
>>
>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> 
> Thanks for fixing my mistake.
> Reviewed-by: Baolin Wang <baolin.wang@linaro.org>
> 

Glad to help. :)

Thanks
--
Gustavo
Linus Walleij Feb. 13, 2019, 9:40 a.m. UTC | #3
On Mon, Feb 11, 2019 at 7:50 PM Gustavo A. R. Silva
<gustavo@embeddedor.com> wrote:

> Fix the following warning by adding a missing break:
>
> drivers/gpio/gpio-eic-sprd.c: In function ‘sprd_eic_irq_set_type’:
> drivers/gpio/gpio-eic-sprd.c:403:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
>    switch (flow_type) {
>    ^~~~~~
> drivers/gpio/gpio-eic-sprd.c:435:2: note: here
>   default:
>   ^~~~~~~
>
> This patch is part of the ongoing efforts to enable
> -Wimplicit-fallthrough.
>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>

Patch applied with Baolin's review tag.

Yours,
Linus Walleij

Patch
diff mbox series

diff --git a/drivers/gpio/gpio-eic-sprd.c b/drivers/gpio/gpio-eic-sprd.c
index e41223c05f6e..f0223cee9774 100644
--- a/drivers/gpio/gpio-eic-sprd.c
+++ b/drivers/gpio/gpio-eic-sprd.c
@@ -432,6 +432,7 @@  static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type)
 		default:
 			return -ENOTSUPP;
 		}
+		break;
 	default:
 		dev_err(chip->parent, "Unsupported EIC type.\n");
 		return -ENOTSUPP;