diff options
author | Alexandre Bailon <abailon@baylibre.com> | 2016-03-08 16:37:37 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2016-03-09 22:31:32 -0800 |
commit | 58a527afff2b27bc912dbb7111d3f23d4f28105b (patch) | |
tree | b159c50eed1cadb17c0b23694b6c61101a4cac97 /drivers/staging/greybus/loopback.c | |
parent | 89ec14ceaedf887fb666f09e1b768afdc32cb291 (diff) |
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 <abailon@baylibre.com>
Reviewed-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/loopback.c')
-rw-r--r-- | drivers/staging/greybus/loopback.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/greybus/loopback.c b/drivers/staging/greybus/loopback.c index 75bff56b48c3..9f1cd9d6cd54 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); \ |