Skip to content

Commit

Permalink
hwmon: (f75375s) Fix warning message seen in some configurations
Browse files Browse the repository at this point in the history
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]>
Signed-off-by: Guenter Roeck <[email protected]>
Acked-by: Jean Delvare <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
  • Loading branch information
groeck authored and Guenter Roeck committed Apr 1, 2012
1 parent 52f30f7 commit 6394011
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/hwmon/f75375s.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ static bool duty_mode_enabled(u8 pwm_enable)
return false;
default:
BUG();
return true;
}
}

Expand All @@ -291,6 +292,7 @@ static bool auto_mode_enabled(u8 pwm_enable)
return true;
default:
BUG();
return false;
}
}

Expand Down

0 comments on commit 6394011

Please sign in to comment.