[PATCH] hwmon: (lm75) Add explicit default cases in lm75_is_visible()

Flaviu Nistor posted 1 patch 2 months ago
drivers/hwmon/lm75.c | 4 ++++
1 file changed, 4 insertions(+)
[PATCH] hwmon: (lm75) Add explicit default cases in lm75_is_visible()
Posted by Flaviu Nistor 2 months ago
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.

Signed-off-by: Flaviu Nistor <flaviu.nistor@gmail.com>
---
 drivers/hwmon/lm75.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
index f1a1e5b888f6..e132501bbfdf 100644
--- a/drivers/hwmon/lm75.c
+++ b/drivers/hwmon/lm75.c
@@ -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:
-- 
2.34.1
Re: [PATCH] hwmon: (lm75) Add explicit default cases in lm75_is_visible()
Posted by Guenter Roeck 1 month, 2 weeks ago
On Fri, Apr 17, 2026 at 08:57:00AM +0300, Flaviu Nistor wrote:
> 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.
> 
> Signed-off-by: Flaviu Nistor <flaviu.nistor@gmail.com>

Applied.

Thanks,
Guenter