Re: [PATCH 17/17] drivers/hwmon/i5k_amb.c: fix checkpatch issues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Frans,

On Sun, Jan 08, 2012 at 11:23:40AM -0500, Frans Meulenbroeks wrote:
> Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@xxxxxxxxx>
> ---
>  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@xxxxxxxxxxxxxx
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors


[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux