Commit 58a527af authored by Alexandre Bailon's avatar Alexandre Bailon Committed by Greg Kroah-Hartman

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: default avatarAlexandre Bailon <abailon@baylibre.com>
Reviewed-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 89ec14ce
......@@ -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); \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment