Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4481a7df authored by Maria Yu's avatar Maria Yu
Browse files

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: default avatarMaria Yu <aiquny@codeaurora.org>
parent a5370b86
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
/*
 * 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);