Skip to contentSkip to conversation

gpio: sprd: Add missing break in switch statement

PATCH In review Gustavo A. R. Silva 3 participants 4 messages Feb 11, 2019 – Feb 13, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: sprd: Add missing break in switch statement

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.

---
 drivers/gpio/gpio-eic-sprd.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpio/gpio-eic-sprd.c +1 -0
index e41223c05f6e..f0223cee9774 100644
@@ -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;
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw

Hi Gustavo,

Quoted 7 lines · Gustavo A. R. Silva

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) {
   ^~~~~~
Quoted 8 lines

drivers/gpio/gpio-eic-sprd.c:435:2: note: here
default:
^~~~~~~

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

Thanks for fixing my mistake.

Quoted 19 lines
---
 drivers/gpio/gpio-eic-sprd.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpio/gpio-eic-sprd.c +1 -1
index e41223c05f6e..f0223cee9774 100644
@@ -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

Signature · 2 lines
Baolin Wang
Best Regards
#2 lore raw

Hi Baolin,

Quoted 15 lines · Baolin Wang

Hi Gustavo,

Quoted 11 lines · Gustavo A. R. Silva

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:
^~~~~~~

Quoted 8 lines
Quoted 4 lines

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

Thanks for fixing my mistake.

Glad to help. :)

Thanks
--
Gustavo

#3 lore raw
In reply to Gustavo A. R. Silva
Quoted 6 lines · Gustavo A. R. Silva

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) {
   ^~~~~~
Quoted 8 lines

drivers/gpio/gpio-eic-sprd.c:435:2: note: here
default:
^~~~~~~

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

Patch applied with Baolin's review tag.

Yours,
Linus Walleij