PM / devfreq: bw_hwmon: use unsigned parameter for bytes_to_mbps

In bytes_to_mbps function, the parameter is all unsigned,
so change the decleration of the function to include unsigned long
long to avoid compilation errors in 32 bit environment.
Also changed the return value as unsigned long to avoid
any data loss possible in 64 bit environment.

Change-Id: I90aebfe32e86ebc17c414d6f3c0c3cbd6dddb0bd
Signed-off-by: Santosh Mardi <[email protected]>
This commit is contained in:
Santosh Mardi 2018-11-13 14:57:42 +05:30 • committed by Amir Vajid
commit b04e29f991

View file

@ -154,7 +154,7 @@ out: \
#define MAX_MS 500U
/* Returns MBps of read/writes for the sampling window. */
static unsigned int bytes_to_mbps(long long bytes, unsigned int us)
static unsigned long bytes_to_mbps(unsigned long long bytes, unsigned int us)
{
bytes *= USEC_PER_SEC;
do_div(bytes, us);