Skip to contentSkip to conversation

hwmon: (f75375s) Fix warning message seen in some configurations

PATCH In review Guenter Roeck 2 participants 2 messages Mar 24, 2012 – Mar 27, 2012

Subsystems (2)
lore
Share & tools
lore

Guenter Roeck

author maintainer
#0 lore raw

PATCH 1/1 hwmon: (f75375s) Fix warning message seen in some configurations

In some configurations, BUG() does not result in an endless loop but returns to the caller. This results in the following compiler warning:

drivers/hwmon/f75375s.c: In function 'duty_mode_enabled':
drivers/hwmon/f75375s.c:280: warning: control reaches end of non-void function drivers/hwmon/f75375s.c: In function 'auto_mode_enabled':
drivers/hwmon/f75375s.c:295: warning: control reaches end of non-void function

Fix the warning by returning something sensible after BUG().

Cc Nikolaus Schulz <[email protected]>
Cc Riku Voipio <[email protected]>
---
 drivers/hwmon/f75375s.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/hwmon/f75375s.c +2 -0
index 729499e..ece4159 100644
@@ -276,6 +276,7 @@ static bool duty_mode_enabled(u8 pwm_enable)
 		return false;
 	default:
 		BUG();
+		return true;
 	}
 }
 
@@ -291,6 +292,7 @@ static bool auto_mode_enabled(u8 pwm_enable)
 		return true;
 	default:
 		BUG();
+		return false;
 	}
 }
 
Signature · 7 lines
1.7.5.4


_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Acked-by on v1 1/1
#1 lore raw

Hi Guenter,

Quoted 30 lines · Guenter Roeck

In some configurations, BUG() does not result in an endless loop but returns to the caller. This results in the following compiler warning:

drivers/hwmon/f75375s.c: In function 'duty_mode_enabled':
drivers/hwmon/f75375s.c:280: warning: control reaches end of non-void function drivers/hwmon/f75375s.c: In function 'auto_mode_enabled':
drivers/hwmon/f75375s.c:295: warning: control reaches end of non-void function

Fix the warning by returning something sensible after BUG().

Cc Nikolaus Schulz <[email protected]>
Cc Riku Voipio <[email protected]>
---
 drivers/hwmon/f75375s.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/hwmon/f75375s.c +1 -0
index 729499e..ece4159 100644
@@ -276,6 +276,7 @@ static bool duty_mode_enabled(u8 pwm_enable)
 		return false;
 	default:
 		BUG();
+		return true;
 	}
 }
 

drivers/hwmon/f75375s.c static bool auto_mode_enabled(u8 pwm_enable) · line 297

Quoted 6 lines
drivers/hwmon/f75375s.c +1 -0
@@ -291,6 +292,7 @@ static bool auto_mode_enabled(u8 pwm_enable)
 		return true;
 	default:
 		BUG();
+		return false;
 	}
 }
Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors