Skip to contentSkip to conversation

hwmon: (lm75) Add explicit default cases in lm75_is_visible()

PATCH Applied Flaviu Nistor 2 participants 2 messages Apr 17 – Apr 30 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: (lm75) Add explicit default cases in lm75_is_visible()

Add explicit default labels to switch statements in lm75_is_visible().

This makes the control flow explicit and improves
readability, but also keeps consistency to other
usage of the switch statement in the driver.

---
 drivers/hwmon/lm75.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/hwmon/lm75.c +4 -0
index f1a1e5b888f6..e132501bbfdf 100644
@@ -539,6 +539,8 @@ static umode_t lm75_is_visible(const void *data, enum hwmon_sensor_types type,
 			if (config_data->params->num_sample_times > 1)
 				return 0644;
 			return 0444;
+		default:
+			break;
 		}
 		break;
 	case hwmon_temp:
@@ -555,6 +557,8 @@ static umode_t lm75_is_visible(const void *data, enum hwmon_sensor_types type,
 			if (config_data->params->alarm)
 				return 0444;
 			break;
+		default:
+			break;
 		}
 		break;
 	default:
Signature · 1 line
2.34.1
maintainer Applied
#1 lore raw
Quoted 8 lines · Flaviu Nistor

Add explicit default labels to switch statements in lm75_is_visible().

This makes the control flow explicit and improves
readability, but also keeps consistency to other
usage of the switch statement in the driver.

Applied.

Thanks,
Guenter