lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180509172926.GA20996@roeck-us.net>
Date:   Wed, 9 May 2018 10:29:26 -0700
From:   Guenter Roeck <linux@...ck-us.net>
To:     Shilpasri G Bhat <shilpa.bhat@...ux.vnet.ibm.com>
Cc:     mpe@...erman.id.au, linux-kernel@...r.kernel.org,
        linuxppc-dev@...ts.ozlabs.org, linux-hwmon@...r.kernel.org,
        benh@...nel.crashing.org, paulus@...ba.org, jdelvare@...e.com,
        stewart@...ux.vnet.ibm.com
Subject: Re: [PATCH 2/3] hwmon: (ibmpowernv): Add support to read 64 bit
 sensors

On Mon, May 07, 2018 at 03:55:37PM +0530, Shilpasri G Bhat wrote:
> The firmware has supported for reading sensor values of size u32.
> This patch adds support to use newer firmware functions which allows
> to read the sensors of size u64.
> 
> Signed-off-by: Shilpasri G Bhat <shilpa.bhat@...ux.vnet.ibm.com>

Acked-by: Guenter Roeck <linux@...ck-us.net>

I won't apply for the time being since it depends on patch 1/3 which is
outside hwmon.

> ---
>  drivers/hwmon/ibmpowernv.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/hwmon/ibmpowernv.c b/drivers/hwmon/ibmpowernv.c
> index 5ccdd0b..74d9b5a 100644
> --- a/drivers/hwmon/ibmpowernv.c
> +++ b/drivers/hwmon/ibmpowernv.c
> @@ -101,9 +101,10 @@ static ssize_t show_sensor(struct device *dev, struct device_attribute *devattr,
>  	struct sensor_data *sdata = container_of(devattr, struct sensor_data,
>  						 dev_attr);
>  	ssize_t ret;
> -	u32 x;
> +	u64 x;
> +
> +	ret =  opal_get_sensor_data_u64(sdata->id, &x);
>  
> -	ret = opal_get_sensor_data(sdata->id, &x);
>  	if (ret)
>  		return ret;
>  
> @@ -114,7 +115,7 @@ static ssize_t show_sensor(struct device *dev, struct device_attribute *devattr,
>  	else if (sdata->type == POWER_INPUT)
>  		x *= 1000000;
>  
> -	return sprintf(buf, "%u\n", x);
> +	return sprintf(buf, "%llu\n", x);
>  }
>  
>  static ssize_t show_label(struct device *dev, struct device_attribute *devattr,
> -- 
> 1.8.3.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-hwmon" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ