From 58a527afff2b27bc912dbb7111d3f23d4f28105b Mon Sep 17 00:00:00 2001 From: Alexandre Bailon Date: Tue, 8 Mar 2016 16:37:37 +0100 Subject: [PATCH] greybus: loopback: round closest the sixth decimal The original round was removed becaused it was rounding the integer whereas we had decimals. Round the sixth decimal. Signed-off-by: Alexandre Bailon Reviewed-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/loopback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/greybus/loopback.c b/drivers/staging/greybus/loopback.c index 75bff56..9f1cd9d 100644 --- a/drivers/staging/greybus/loopback.c +++ b/drivers/staging/greybus/loopback.c @@ -162,7 +162,7 @@ static ssize_t name##_avg_show(struct device *dev, \ gb = dev_get_drvdata(dev); \ stats = &gb->name; \ count = stats->count ? stats->count : 1; \ - avg = stats->sum; \ + avg = stats->sum + count / 2000000; /* round closest */ \ rem = do_div(avg, count); \ rem *= 1000000; \ do_div(rem, count); \ -- 2.7.4