Skip to contentSkip to conversation

pinctrl: actions: fix missing break in PIN_CONFIG_DRIVE_STRENGTH case.

PATCH In review Colin King 3 participants 3 messages Apr 30, 2018 – May 2, 2018

Subsystems (4)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH v2 1/1 pinctrl: actions: fix missing break in PIN_CONFIG_DRIVE_STRENGTH case.

From: Colin Ian King <[email protected]>

There is a missing break in case PIN_CONFIG_DRIVE_STRENGTH leading to a fall-through to the PIN_CONFIG_SLEW_RATE case that performs different checks against *arg. This looks like an unintentional missing break so add in the break.

Detected by CoverityScan, CID#1468456, 1468459 ("Missing break in switch")

Fixes 513d7a2f7e0f ("pinctrl: actions: Add Actions S900 pinctrl driver")
---
 drivers/pinctrl/actions/pinctrl-owl.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/pinctrl/actions/pinctrl-owl.c +2 -0
index 928b40f71a3c..ee090697b1e9 100644
@@ -406,6 +406,7 @@ static int owl_group_pinconf_arg2val(const struct owl_pingroup *g,
 		default:
 			return -EINVAL;
 		}
+		break;
 	case PIN_CONFIG_SLEW_RATE:
 		if (*arg)
 			*arg = OWL_PINCONF_SLEW_FAST;
@@ -441,6 +442,7 @@ static int owl_group_pinconf_val2arg(const struct owl_pingroup *g,
 		default:
 			return -EINVAL;
 		}
+		break;
 	case PIN_CONFIG_SLEW_RATE:
 		if (*arg)
 			*arg = 1;
Signature · 1 line
2.17.0
Acked-by on v2 1/1
#1 lore raw
Quoted 9 lines · Colin King

From: Colin Ian King <[email protected]>

There is a missing break in case PIN_CONFIG_DRIVE_STRENGTH leading to a fall-through to the PIN_CONFIG_SLEW_RATE case that performs different checks against *arg. This looks like an unintentional missing break so add in the break.

Detected by CoverityScan, CID#1468456, 1468459 ("Missing break in switch")

Thanks for fixing!

Quoted 2 lines
Fixes 513d7a2f7e0f ("pinctrl: actions: Add Actions S900 pinctrl driver")

Thanks,
Mani

Quoted 27 lines
---
 drivers/pinctrl/actions/pinctrl-owl.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/pinctrl/actions/pinctrl-owl.c +2 -0
index 928b40f71a3c..ee090697b1e9 100644
@@ -406,6 +406,7 @@ static int owl_group_pinconf_arg2val(const struct owl_pingroup *g,
 		default:
 			return -EINVAL;
 		}
+		break;
 	case PIN_CONFIG_SLEW_RATE:
 		if (*arg)
 			*arg = OWL_PINCONF_SLEW_FAST;
@@ -441,6 +442,7 @@ static int owl_group_pinconf_val2arg(const struct owl_pingroup *g,
 		default:
 			return -EINVAL;
 		}
+		break;
 	case PIN_CONFIG_SLEW_RATE:
 		if (*arg)
 			*arg = 1;
Signature · 1 line
2.17.0
#2 lore raw
In reply to Colin King
Quoted 11 lines · Colin King

From: Colin Ian King <[email protected]>

There is a missing break in case PIN_CONFIG_DRIVE_STRENGTH leading to a fall-through to the PIN_CONFIG_SLEW_RATE case that performs different checks against *arg. This looks like an unintentional missing break so add in the break.

Detected by CoverityScan, CID#1468456, 1468459 ("Missing break in switch")

Fixes 513d7a2f7e0f ("pinctrl: actions: Add Actions S900 pinctrl driver")

This v2 applied with Manivannan's ACK.

Yours,
Linus Walleij