hwmon: replace impossible fallthroughs with breaks
Subsystems (2)
PATCH 1/1 hwmon: replace impossible fallthroughs with breaks
It's impossible to reach these fall through statements because all the possible values are handled. In that situation it's cleaner to use a break statement instead of a fall through statement.
Fixes c947e51cf803 ("hwmon: (adt7462) Mark expected switch fall-throughs")
Signed-off-by Dan Carpenter <[email protected]>
--- drivers/hwmon/adt7462.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/hwmon/adt7462.c +4 -4
@@ -435,7 +435,7 @@ static const char *voltage_label(struct adt7462_data *data, int which)case 3 :return "+1.5V" ; } - fallthrough; +break ;case 2 :if (!(data->pin_cfg[1 ] &ADT7462_PIN22_INPUT ))return "+12V3" ;
@@ -493,7 +493,7 @@ static const char *voltage_label(struct adt7462_data *data, int which)case 3 :return "+1.5" ; } - fallthrough; +break ;case 11 :if (data->pin_cfg[3 ] >>ADT7462_PIN28_SHIFT = ADT7462_PIN28_VOLT &&
@@ -531,7 +531,7 @@ static int voltage_multiplier(struct adt7462_data *data, int which)case 3 :return 7800 ; } - fallthrough; +break ;case 2 :if (!(data->pin_cfg[1 ] &ADT7462_PIN22_INPUT ))return 62500 ;
@@ -589,7 +589,7 @@ static int voltage_multiplier(struct adt7462_data *data, int which)case 3 :return 7800 ; } - fallthrough; +break ;case 11 :case 12 : if (data->pin_cfg[3] >> ADT7462_PIN28_SHIFT =
Signature · 1 line
2.28.0
Guenter Roeck
maintainerQuoted 4 lines · Dan Carpenter
It's impossible to reach these fall through statements because all the possible values are handled. In that situation it's cleaner to use a break statement instead of a fall through statement.
Makes sense. Applied.
Thanks,
Guenter
Quoted 46 lines
Fixes c947e51cf803 ("hwmon: (adt7462) Mark expected switch fall-throughs")Signed-off-by Dan Carpenter <[email protected]>--- drivers/hwmon/adt7462.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/hwmon/adt7462.c +4
-4@@ -435,7 +435,7 @@ static const char *voltage_label(struct adt7462_data *data, int which)case 3 :return "+1.5V" ; } - fallthrough; +break ;case 2 :if (!(data->pin_cfg[1 ] &ADT7462_PIN22_INPUT ))return "+12V3" ;@@ -493,7 +493,7 @@ static const char *voltage_label(struct adt7462_data *data, int which)case 3 :return "+1.5" ; } - fallthrough; +break ;case 11 :if (data->pin_cfg[3 ] >>ADT7462_PIN28_SHIFT = ADT7462_PIN28_VOLT &&@@ -531,7 +531,7 @@ static int voltage_multiplier(struct adt7462_data *data, int which)case 3 :return 7800 ; } - fallthrough; +break ;case 2 :if (!(data->pin_cfg[1 ] &ADT7462_PIN22_INPUT ))return 62500 ;@@ -589,7 +589,7 @@ static int voltage_multiplier(struct adt7462_data *data, int which)case 3 :return 7800 ; } - fallthrough; +break ;case 11 :case 12 : if (data->pin_cfg[3] >> ADT7462_PIN28_SHIFT =