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: Ib3906bb4bc16086ae343764c5a718f6f005428c5
Signed-off-by: Maria Yu <aiquny@codeaurora.org>
This commit is contained in:
Maria Yu 2018-03-02 16:23:32 +08:00 committed by Timi
parent ccb2777821
commit 76ed2e927d

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved. * Copyright (c) 2013-2018, The Linux Foundation. All rights reserved.
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and * it under the terms of the GNU General Public License version 2 and
@ -175,7 +175,7 @@ static DEVICE_ATTR(__attr, 0644, show_list_##__attr, store_list_##__attr)
#define MAX_MS 500U #define MAX_MS 500U
/* Returns MBps of read/writes for the sampling window. */ /* 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; bytes *= USEC_PER_SEC;
do_div(bytes, us); do_div(bytes, us);