]> git.baikalelectronics.ru Git - kernel.git/commit
regulator: axp20x: Mark expected switch fall-throughs
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Wed, 20 Mar 2019 16:56:43 +0000 (11:56 -0500)
committerMark Brown <broonie@kernel.org>
Wed, 20 Mar 2019 17:19:31 +0000 (17:19 +0000)
commit25c31e047307583ffcff63997fbe2fd591dd8ad8
treeea7af75d48876c30606b04f7adc8e3976d0b0f19
parente46be8a9cc7042ce72a7bd60d880447e0219fbbc
regulator: axp20x: Mark expected switch fall-throughs

In preparation to enabling -Wimplicit-fallthrough, mark switch
cases where we are expecting to fall through.

This patch fixes the following warnings:

drivers/regulator/axp20x-regulator.c: In function ‘axp20x_set_dcdc_freq’:
drivers/regulator/axp20x-regulator.c:1023:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
   reg = AXP803_DCDC_FREQ_CTRL;
drivers/regulator/axp20x-regulator.c:1025:2: note: here
  case AXP806_ID:
  ^~~~
drivers/regulator/axp20x-regulator.c: In function ‘axp20x_set_dcdc_workmode’:
drivers/regulator/axp20x-regulator.c:1115:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
   reg = AXP806_DCDC_MODE_CTRL2;
drivers/regulator/axp20x-regulator.c:1121:2: note: here
  case AXP221_ID:
  ^~~~

Notice that in this particular case, I moved the whole comment
"Fall through to the check below.", which contains the "Fall through"
comment, at the bottom of the case, which is what GCC is expecting
to find.

Warning level 3 was used: -Wimplicit-fallthrough=3

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

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/axp20x-regulator.c