[next] pinctrl: actions: fix missing break in PIN_CONFIG_DRIVE_STRENGTH case.
diff mbox series

Message ID 20180430131420.6155-1-colin.king@canonical.com
State New
Headers show
Series
  • [next] pinctrl: actions: fix missing break in PIN_CONFIG_DRIVE_STRENGTH case.
Related show

Commit Message

Colin King April 30, 2018, 1:14 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

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#1468459 ("Missing break in switch")

Fixes: 513d7a2f7e0f ("pinctrl: actions: Add Actions S900 pinctrl driver")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/pinctrl/actions/pinctrl-owl.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Manivannan Sadhasivam April 30, 2018, 1:19 p.m. UTC | #1
Hi Colin,

On Mon, Apr 30, 2018 at 02:14:20PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> 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.
> 

Yes, break has been left out by mistake. Thanks for fixing!

> Detected by CoverityScan, CID#1468459 ("Missing break in switch")
> 
> Fixes: 513d7a2f7e0f ("pinctrl: actions: Add Actions S900 pinctrl driver")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Acked-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> 

Thanks,
Mani

> ---
>  drivers/pinctrl/actions/pinctrl-owl.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/pinctrl/actions/pinctrl-owl.c b/drivers/pinctrl/actions/pinctrl-owl.c
> index 928b40f71a3c..d15abb97821e 100644
> --- a/drivers/pinctrl/actions/pinctrl-owl.c
> +++ b/drivers/pinctrl/actions/pinctrl-owl.c
> @@ -441,6 +441,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;
> -- 
> 2.17.0
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Colin King April 30, 2018, 1:19 p.m. UTC | #2
On 30/04/18 14:19, Manivannan Sadhasivam wrote:
> Hi Colin,
> 
> On Mon, Apr 30, 2018 at 02:14:20PM +0100, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> 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.
>>
> 
> Yes, break has been left out by mistake. Thanks for fixing!

I've noticed another missing break, I'll send a V2.

Colin
> 
>> Detected by CoverityScan, CID#1468459 ("Missing break in switch")
>>
>> Fixes: 513d7a2f7e0f ("pinctrl: actions: Add Actions S900 pinctrl driver")
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> 
> Acked-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> 
> 
> Thanks,
> Mani
> 
>> ---
>>  drivers/pinctrl/actions/pinctrl-owl.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/pinctrl/actions/pinctrl-owl.c b/drivers/pinctrl/actions/pinctrl-owl.c
>> index 928b40f71a3c..d15abb97821e 100644
>> --- a/drivers/pinctrl/actions/pinctrl-owl.c
>> +++ b/drivers/pinctrl/actions/pinctrl-owl.c
>> @@ -441,6 +441,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;
>> -- 
>> 2.17.0
>>

--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox series

diff --git a/drivers/pinctrl/actions/pinctrl-owl.c b/drivers/pinctrl/actions/pinctrl-owl.c
index 928b40f71a3c..d15abb97821e 100644
--- a/drivers/pinctrl/actions/pinctrl-owl.c
+++ b/drivers/pinctrl/actions/pinctrl-owl.c
@@ -441,6 +441,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;