From 4481a7df4f78148937d173b8d815eccbe2b95d82 Mon Sep 17 00:00:00 2001 From: Maria Yu Date: Fri, 2 Mar 2018 16:23:32 +0800 Subject: [PATCH] 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 --- drivers/devfreq/governor_bw_hwmon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/devfreq/governor_bw_hwmon.c b/drivers/devfreq/governor_bw_hwmon.c index 3026bc22b374..cb04014f777f 100644 --- a/drivers/devfreq/governor_bw_hwmon.c +++ b/drivers/devfreq/governor_bw_hwmon.c @@ -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 * it under the terms of the GNU General Public License version 2 and @@ -171,7 +171,7 @@ static DEVICE_ATTR(__attr, 0644, show_list_##__attr, store_list_##__attr) #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);