diff mbox

[03/19] mfd: tps80031: Fix 'missing break or fall-through comment' warning

Message ID 1406027485-15657-4-git-send-email-lee.jones@linaro.org
State New
Headers show

Commit Message

Lee Jones July 22, 2014, 11:11 a.m. UTC
This is part of an effort to clean-up the MFD subsystem.

WARNING: Possible switch case/default not preceeded by break or fallthrough comment
+       case TPS80031_BACKUP_REG:

total: 0 errors, 1 warnings, 573 lines checked

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/tps80031.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Arnd Bergmann July 22, 2014, 11:33 a.m. UTC | #1
On Tuesday 22 July 2014 12:11:09 Lee Jones wrote:
> --- a/drivers/mfd/tps80031.c
> +++ b/drivers/mfd/tps80031.c
> @@ -334,6 +334,7 @@ static bool rd_wr_reg_id1(struct device *dev, unsigned int reg)
>         case TPS80031_PREQ1_RES_ASS_A ... TPS80031_PREQ3_RES_ASS_C:
>         case TPS80031_SMPS_OFFSET ... TPS80031_BATDEBOUNCING:
>         case TPS80031_CFG_INPUT_PUPD1 ... TPS80031_CFG_SMPS_PD:
> +               /* Fall through */
>         case TPS80031_BACKUP_REG:
>                 return true;
>         default:

This one seems to make the code look worse: You are only adding the comment
to one case, not all of them, and it was perfectly understandable
before.

Further, there are a couple of other functions following this one that
also don't have that comment.

It seems checkpatch missed all the other cases because they contain '...'
lists, whereas the one above does not. I think it's better left alone.

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Lee Jones July 22, 2014, 12:08 p.m. UTC | #2
On Tue, 22 Jul 2014, Arnd Bergmann wrote:

> On Tuesday 22 July 2014 12:11:09 Lee Jones wrote:
> > --- a/drivers/mfd/tps80031.c
> > +++ b/drivers/mfd/tps80031.c
> > @@ -334,6 +334,7 @@ static bool rd_wr_reg_id1(struct device *dev, unsigned int reg)
> >         case TPS80031_PREQ1_RES_ASS_A ... TPS80031_PREQ3_RES_ASS_C:
> >         case TPS80031_SMPS_OFFSET ... TPS80031_BATDEBOUNCING:
> >         case TPS80031_CFG_INPUT_PUPD1 ... TPS80031_CFG_SMPS_PD:
> > +               /* Fall through */
> >         case TPS80031_BACKUP_REG:
> >                 return true;
> >         default:
> 
> This one seems to make the code look worse: You are only adding the comment
> to one case, not all of them, and it was perfectly understandable
> before.
> 
> Further, there are a couple of other functions following this one that
> also don't have that comment.
> 
> It seems checkpatch missed all the other cases because they contain '...'
> lists, whereas the one above does not. I think it's better left alone.

You're right.  I forgot to remove this patch from the set.

Please see: https://lkml.org/lkml/2014/7/21/223
diff mbox

Patch

diff --git a/drivers/mfd/tps80031.c b/drivers/mfd/tps80031.c
index ed6c5b0..7a3806c 100644
--- a/drivers/mfd/tps80031.c
+++ b/drivers/mfd/tps80031.c
@@ -334,6 +334,7 @@  static bool rd_wr_reg_id1(struct device *dev, unsigned int reg)
 	case TPS80031_PREQ1_RES_ASS_A ... TPS80031_PREQ3_RES_ASS_C:
 	case TPS80031_SMPS_OFFSET ... TPS80031_BATDEBOUNCING:
 	case TPS80031_CFG_INPUT_PUPD1 ... TPS80031_CFG_SMPS_PD:
+		/* Fall through */
 	case TPS80031_BACKUP_REG:
 		return true;
 	default: