linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali.rohar@gmail.com>
To: Guenter Roeck <linux@roeck-us.net>, Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, "Pali Rohár" <pali.rohar@gmail.com>
Subject: [PATCH 07/10] i8k: Make fan module parameters an unsigned
Date: Sun, 21 Dec 2014 20:54:40 +0100	[thread overview]
Message-ID: <1419191683-31435-8-git-send-email-pali.rohar@gmail.com> (raw)
In-Reply-To: <1419191683-31435-1-git-send-email-pali.rohar@gmail.com>

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: Pali Rohár <pali.rohar@gmail.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/char/i8k.c |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/char/i8k.c b/drivers/char/i8k.c
index 8ec4c37..d6e8a26 100644
--- a/drivers/char/i8k.c
+++ b/drivers/char/i8k.c
@@ -64,9 +64,9 @@ static DEFINE_MUTEX(i8k_mutex);
 static char bios_version[4];
 static struct device *i8k_hwmon_dev;
 static u32 i8k_hwmon_flags;
-static int i8k_fan_mult;
-static int i8k_pwm_mult;
-static int i8k_fan_max = I8K_FAN_HIGH;
+static uint i8k_fan_mult;
+static uint i8k_pwm_mult;
+static uint i8k_fan_max = I8K_FAN_HIGH;
 
 #define I8K_HWMON_HAVE_TEMP1	(1 << 0)
 #define I8K_HWMON_HAVE_TEMP2	(1 << 1)
@@ -95,12 +95,12 @@ static bool power_status;
 module_param(power_status, bool, 0600);
 MODULE_PARM_DESC(power_status, "Report power status in /proc/i8k");
 
-static int fan_mult = I8K_FAN_MULT;
-module_param(fan_mult, int, 0);
+static uint fan_mult = I8K_FAN_MULT;
+module_param(fan_mult, uint, 0);
 MODULE_PARM_DESC(fan_mult, "Factor to multiply fan speed with");
 
-static int fan_max = I8K_FAN_HIGH;
-module_param(fan_max, int, 0);
+static uint fan_max = I8K_FAN_HIGH;
+module_param(fan_max, uint, 0);
 MODULE_PARM_DESC(fan_max, "Maximum configurable fan speed");
 
 static int i8k_open_fs(struct inode *inode, struct file *file);
@@ -696,8 +696,8 @@ static int __init i8k_init_hwmon(void)
 }
 
 struct i8k_config_data {
-	int fan_mult;
-	int fan_max;
+	uint fan_mult;
+	uint fan_max;
 };
 
 enum i8k_configs {
-- 
1.7.9.5


  parent reply	other threads:[~2014-12-21 19:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-21 19:54 [PATCH 00/10] i8k patches Pali Rohár
2014-12-21 19:54 ` [PATCH 01/10] i8k: Add support for temperature sensor labels Pali Rohár
2014-12-21 19:54 ` [PATCH 02/10] i8k: Register only temperature sensors which have labels Pali Rohár
2014-12-21 19:54 ` [PATCH 03/10] i8k: Return -ENODATA for invalid temperature Pali Rohár
2014-12-21 19:54 ` [PATCH 04/10] MAINTAINERS: Fix up entry for Dell laptop SMM driver Pali Rohár
2014-12-21 19:54 ` [PATCH 05/10] i8k: Rework error retries Pali Rohár
2014-12-21 19:54 ` [PATCH 06/10] i8k: Add support for Dell XPS 13 Pali Rohár
2014-12-21 19:54 ` Pali Rohár [this message]
2014-12-21 19:54 ` [PATCH 08/10] i8k: Autodetect maximal fan speed and fan RPM multiplier Pali Rohár
2014-12-21 22:58   ` Guenter Roeck
2014-12-21 19:54 ` [PATCH 09/10] i8k: Remove DMI config data for Latitude E6440 and E6540 Pali Rohár
2014-12-21 22:58   ` Guenter Roeck
2014-12-21 19:54 ` [PATCH 10/10] i8k: Add support for fan labels Pali Rohár
2014-12-21 23:01   ` Guenter Roeck
2014-12-22  8:07     ` Pali Rohár

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1419191683-31435-8-git-send-email-pali.rohar@gmail.com \
    --to=pali.rohar@gmail.com \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).