Commit 7f69fb03 authored by Pali Rohár's avatar Pali Rohár Committed by Greg Kroah-Hartman

i8k: Make fan module parameters an unsigned

Setting negative fan multiplier or maximal fan speed does make any sense and
can cause problems. So ensure that negative values will not be accepted.
Signed-off-by: default avatarPali Rohár <pali.rohar@gmail.com>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 34ae40f6
...@@ -64,9 +64,9 @@ static DEFINE_MUTEX(i8k_mutex); ...@@ -64,9 +64,9 @@ static DEFINE_MUTEX(i8k_mutex);
static char bios_version[4]; static char bios_version[4];
static struct device *i8k_hwmon_dev; static struct device *i8k_hwmon_dev;
static u32 i8k_hwmon_flags; static u32 i8k_hwmon_flags;
static int i8k_fan_mult; static uint i8k_fan_mult;
static int i8k_pwm_mult; static uint i8k_pwm_mult;
static int i8k_fan_max = I8K_FAN_HIGH; static uint i8k_fan_max = I8K_FAN_HIGH;
#define I8K_HWMON_HAVE_TEMP1 (1 << 0) #define I8K_HWMON_HAVE_TEMP1 (1 << 0)
#define I8K_HWMON_HAVE_TEMP2 (1 << 1) #define I8K_HWMON_HAVE_TEMP2 (1 << 1)
...@@ -95,12 +95,12 @@ static bool power_status; ...@@ -95,12 +95,12 @@ static bool power_status;
module_param(power_status, bool, 0600); module_param(power_status, bool, 0600);
MODULE_PARM_DESC(power_status, "Report power status in /proc/i8k"); MODULE_PARM_DESC(power_status, "Report power status in /proc/i8k");
static int fan_mult = I8K_FAN_MULT; static uint fan_mult = I8K_FAN_MULT;
module_param(fan_mult, int, 0); module_param(fan_mult, uint, 0);
MODULE_PARM_DESC(fan_mult, "Factor to multiply fan speed with"); MODULE_PARM_DESC(fan_mult, "Factor to multiply fan speed with");
static int fan_max = I8K_FAN_HIGH; static uint fan_max = I8K_FAN_HIGH;
module_param(fan_max, int, 0); module_param(fan_max, uint, 0);
MODULE_PARM_DESC(fan_max, "Maximum configurable fan speed"); MODULE_PARM_DESC(fan_max, "Maximum configurable fan speed");
static int i8k_open_fs(struct inode *inode, struct file *file); static int i8k_open_fs(struct inode *inode, struct file *file);
...@@ -696,8 +696,8 @@ static int __init i8k_init_hwmon(void) ...@@ -696,8 +696,8 @@ static int __init i8k_init_hwmon(void)
} }
struct i8k_config_data { struct i8k_config_data {
int fan_mult; uint fan_mult;
int fan_max; uint fan_max;
}; };
enum i8k_configs { enum i8k_configs {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment