diff mbox

power: supply: max77693_charger: fix unintentional fall-through

Message ID 20180717214739.GA19410@embeddedor.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Gustavo A. R. Silva July 17, 2018, 9:47 p.m. UTC
It seems that a *break* is missing in order to avoid a fall-through.
Otherwise, the calculation of *data* makes no sense.

Addresses-Coverity-ID: 1271172 ("Missing break in switch")
Fixes: 87c2d9067893 ("power: max77693: Add charger driver for Maxim 77693")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/power/supply/max77693_charger.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Krzysztof Kozlowski July 18, 2018, 6:14 a.m. UTC | #1
On 17 July 2018 at 23:47, Gustavo A. R. Silva <gustavo@embeddedor.com> wrote:
> It seems that a *break* is missing in order to avoid a fall-through.
> Otherwise, the calculation of *data* makes no sense.
>
> Addresses-Coverity-ID: 1271172 ("Missing break in switch")
> Fixes: 87c2d9067893 ("power: max77693: Add charger driver for Maxim 77693")
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> ---
>  drivers/power/supply/max77693_charger.c | 1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>

Best regards,
Krzysztof
Gustavo A. R. Silva July 19, 2018, 1:54 p.m. UTC | #2
Hi Krzysztof,

On 07/18/2018 01:14 AM, Krzysztof Kozlowski wrote:
> On 17 July 2018 at 23:47, Gustavo A. R. Silva <gustavo@embeddedor.com> wrote:
>> It seems that a *break* is missing in order to avoid a fall-through.
>> Otherwise, the calculation of *data* makes no sense.
>>
>> Addresses-Coverity-ID: 1271172 ("Missing break in switch")
>> Fixes: 87c2d9067893 ("power: max77693: Add charger driver for Maxim 77693")
>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>> ---
>>  drivers/power/supply/max77693_charger.c | 1 +
>>  1 file changed, 1 insertion(+)
> 
> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
> 

BTW, I think this also should be tagged for stable.

Thanks
--
Gustavo
Sebastian Reichel July 22, 2018, 10:17 p.m. UTC | #3
Hi,

On Wed, Jul 18, 2018 at 08:14:50AM +0200, Krzysztof Kozlowski wrote:
> On 17 July 2018 at 23:47, Gustavo A. R. Silva <gustavo@embeddedor.com> wrote:
> > It seems that a *break* is missing in order to avoid a fall-through.
> > Otherwise, the calculation of *data* makes no sense.
> >
> > Addresses-Coverity-ID: 1271172 ("Missing break in switch")
> > Fixes: 87c2d9067893 ("power: max77693: Add charger driver for Maxim 77693")
> > Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> > ---
> >  drivers/power/supply/max77693_charger.c | 1 +
> >  1 file changed, 1 insertion(+)
> 
> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>

Thanks, queued to power-supply's fixes branch.

-- Sebastian
Gustavo A. R. Silva Aug. 5, 2018, 2:01 a.m. UTC | #4
Hi Sebastian,

On 07/22/2018 05:17 PM, Sebastian Reichel wrote:
> Hi,
> 
> On Wed, Jul 18, 2018 at 08:14:50AM +0200, Krzysztof Kozlowski wrote:
>> On 17 July 2018 at 23:47, Gustavo A. R. Silva <gustavo@embeddedor.com> wrote:
>>> It seems that a *break* is missing in order to avoid a fall-through.
>>> Otherwise, the calculation of *data* makes no sense.
>>>
>>> Addresses-Coverity-ID: 1271172 ("Missing break in switch")
>>> Fixes: 87c2d9067893 ("power: max77693: Add charger driver for Maxim 77693")
>>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>>> ---
>>>  drivers/power/supply/max77693_charger.c | 1 +
>>>  1 file changed, 1 insertion(+)
>>
>> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
> 
> Thanks, queued to power-supply's fixes branch.
> 

I think this should be tagged for stable.

Thanks
--
Gustavo
diff mbox

Patch

diff --git a/drivers/power/supply/max77693_charger.c b/drivers/power/supply/max77693_charger.c
index 6c78884..749c792 100644
--- a/drivers/power/supply/max77693_charger.c
+++ b/drivers/power/supply/max77693_charger.c
@@ -567,6 +567,7 @@  static int max77693_set_charge_input_threshold_volt(struct max77693_charger *chg
 	case 4800000:
 	case 4900000:
 		data = (uvolt - 4700000) / 100000;
+		break;
 	default:
 		dev_err(chg->dev, "Wrong value for charge input voltage regulation threshold\n");
 		return -EINVAL;