All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <guenter.roeck@ericsson.com>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [PATCH 17/17] drivers/hwmon/i5k_amb.c: fix
Date: Sun, 08 Jan 2012 17:15:12 +0000	[thread overview]
Message-ID: <20120108171512.GA23387@ericsson.com> (raw)
In-Reply-To: <1326039820-11147-17-git-send-email-fransmeulenbroeks@gmail.com>

Hi Frans,

On Sun, Jan 08, 2012 at 11:23:40AM -0500, Frans Meulenbroeks wrote:
> Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
> ---
>  drivers/hwmon/i5k_amb.c |   15 ++++++++++++---
>  1 files changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/hwmon/i5k_amb.c b/drivers/hwmon/i5k_amb.c
> index d22f241..c516bdc 100644
> --- a/drivers/hwmon/i5k_amb.c
> +++ b/drivers/hwmon/i5k_amb.c
> @@ -159,7 +159,10 @@ static ssize_t store_amb_min(struct device *dev,
>  {
>  	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
>  	struct i5k_amb_data *data = dev_get_drvdata(dev);
> -	unsigned long temp = simple_strtoul(buf, NULL, 10) / 500;
> +	unsigned long temp;
> +	int ret = kstrtoul(buf, 10, &temp) / 500;

This divides the error code by 500, not temp.

> +	if (ret < 0)
> +		return ret;
>  
>  	if (temp > 255)
>  		temp = 255;
> @@ -175,7 +178,10 @@ static ssize_t store_amb_mid(struct device *dev,
>  {
>  	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
>  	struct i5k_amb_data *data = dev_get_drvdata(dev);
> -	unsigned long temp = simple_strtoul(buf, NULL, 10) / 500;
> +	unsigned long temp;
> +	int ret = kstrtoul(buf, 10, &temp) / 500;

Same here.

> +	if (ret < 0)
> +		return ret;
>  
>  	if (temp > 255)
>  		temp = 255;
> @@ -191,7 +197,10 @@ static ssize_t store_amb_max(struct device *dev,
>  {
>  	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
>  	struct i5k_amb_data *data = dev_get_drvdata(dev);
> -	unsigned long temp = simple_strtoul(buf, NULL, 10) / 500;
> +	unsigned long temp;
> +	int ret = kstrtoul(buf, 10, &temp) / 500;

and here.

Guenter

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

  reply	other threads:[~2012-01-08 17:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-08 16:23 [lm-sensors] [PATCH 17/17] drivers/hwmon/i5k_amb.c: fix checkpatch Frans Meulenbroeks
2012-01-08 17:15 ` Guenter Roeck [this message]
2012-01-08 17:52 ` [lm-sensors] [PATCH 17/17] drivers/hwmon/i5k_amb.c: fix Frans Meulenbroeks
2012-01-08 19:03 ` Guenter Roeck
2012-01-10 14:33 ` Frans Meulenbroeks

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=20120108171512.GA23387@ericsson.com \
    --to=guenter.roeck@ericsson.com \
    --cc=lm-sensors@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.